[Small-cl-src-discuss] Re: [Small-cl-src] Re: simple locking retry
Nathan Froyd
froydnj at cs.rice.edu
Sun Jun 27 20:44:10 UTC 2004
On Sun, Jun 27, 2004 at 02:36:06PM -0400, Randall Randall wrote:
> On Jun 27, 2004, at 8:58 AM, Joe Marshall wrote:
> >This isn't thread safe. If two processes attempted to enter the queue
> >simultaneously, one could get lost.
>
> Because the second could run between evaluation of
> ,queue and evaluation of APPEND? Okay. Is there
> an atomic way to do that append such that it is
> thread safe without using specialized machinery not
> available with serve-event?
CMUCL under x86 supports several "set place atomically" primitives
that use the processor's cmpxchg instruction to provide true
atomicity. (apropos "ATOMIC-") to have a peek at what's there.
Since you're on PPC, this may not help that much...
--
Nathan | From Man's effeminate slackness it begins. --Paradise Lost
More information about the Small-cl-src-discuss
mailing list