Re: C++ in the kernel
- From: Alfred Perlstein <alfred@xxxxxxxxxxx>
- Date: Tue, 30 Oct 2007 13:12:29 -0700
* Bakul Shah <bakul@xxxxxxxxxxxxx> [071030 11:11] wrote:
* Bakul Shah <bakul@xxxxxxxxxxxxx> [071030 09:36] wrote:
The structured macro paper referenced on the K wiki page also
seems rather interesting. A powerful macro facility needs to
be well integrated with the language (much like Lisp or
Scheme's macros) so that you can write for instance
critical_section(lock) {
...
bar:
...
if (cond1) break;
...
if (cond2) goto foo;
...
if (cond3) goto bar;
...
if (cond4) return; // from enclosing function
...
}
...
foo:
do you mean like C++:
do {
critical_object critical_instance();
}
No idea but I can not see how that will do what I had in mind. A purely
lexical translation of the snippet I gave above would be something like:
You can create an object on the stack that locks the mutex given
to it like so:
do {
mtx_lock_object mtx_locker(&lock);
}
When the object is destroyed by stack popping, the lock will be freed.
It's the same thing.
-Alfred
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: C++ in the kernel
- From: Bakul Shah
- Re: C++ in the kernel
- References:
- Re: C++ in the kernel
- From: Alfred Perlstein
- Re: C++ in the kernel
- From: Bakul Shah
- Re: C++ in the kernel
- Prev by Date: Re: C++ in the kernel
- Next by Date: Re: C++ in the kernel
- Previous by thread: Re: C++ in the kernel
- Next by thread: Re: C++ in the kernel
- Index(es):
Relevant Pages
|
|