Re: C++ in the kernel



* 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"



Relevant Pages

  • Computer lock opens VB editor
    ... I installed a macro i designed on a coworkers ... computer and ever since then when ever she locks her computer using ... ctrl alt delete then unlocks it the VB editor opens up. ...
    (microsoft.public.excel.programming)
  • Re: Macro making
    ... Edit the macro so that it unlocks the sheet, ... then locks the sheet again. ... > I assume you're talking about excel. ...
    (microsoft.public.windowsxp.general)
  • visual basic editor lockup
    ... I have a macro that brings up a user form when XL is opened, ... after doing this the visual basic editor and XL locks up. ...
    (microsoft.public.excel.programming)
  • [PATCH] Remove the last reference to rwlock_is_locked() macro.
    ... remaining reference to the long-deceased ... rwlock_is_lockedmacro. ... * Write locks are easy - we just set bit 31. ... When unlocking, we can ...
    (Linux-Kernel)
  • Re: C++ in the kernel
    ... The structured macro paper referenced on the K wiki page also ... if goto foo; ... This as an example of what *I would want* a macro facility to ...
    (freebsd-arch)