[armedbear-devel] [RFC] Support for 'synchronized' blocks in Lisp code
Alessio Stalla
alessiostalla at gmail.com
Tue Jul 7 14:28:32 UTC 2009
On Tue, Jul 7, 2009 at 3:49 PM, Ville
Voutilainen<ville.voutilainen at gmail.com> wrote:
> On Tue, Jul 7, 2009 at 4:30 PM, Erik Huelsmann<ehuels at gmail.com> wrote:
>> I propose that we introduce a WITH-EXCLUSIVE-ACCESS form in the EXT
>> package, which takes 1 argument (the second value) and a body (the
>> third value). The form makes sure that the body is evaluated as if it
>> had been called with:
>> synchronized (arg1) {
>> body-to-evaluate;
>> }
>> Except that it implements this in Lisp. This way, our Lisp<>Java
>> interoperability would increase. It would also be an efficient way to
>> guarantee exclusive access when modifying a cross-thread shared
>> resource (such as generic functions).
>> Comments?
>
> Sounds good, although WITH-EXCLUSIVE-ACCESS isn't very descriptive to
> me, I'd go for WITH-THREAD-LOCK. (not WITH-LOCK, because there are many
> kinds of locks). Just my 0.02. ;)
Do you mean so that Lisp code could be synchronized with Java code on
the same object lock? That would be great. It'll need also a Lisp
interface to wait(), notify() and company, but this is trivial. About
the name, why not SYNCHRONIZED or SYNCHRONIZED-ON or
WITH-SYNCHRONIZED-BLOCK or something like those? It's closer to Java
terminology that way. But, any of the proposed names are fine by me.
A.
More information about the armedbear-devel
mailing list