[Gardeners] Shared State Concurrency specification.
Marco Monteiro
masm at acm.org
Mon Jul 17 16:36:34 CDT 2006
Duncan Rose wrote:
> (let ((closure-var 0))
> (defun some-fun ()
> ;; do some long-running thing with closure-var
> closure-var)
> (defun some-other-fun ()
> ;; do some other long-running thing with closure-var
> closure-var))
>
> (spawn-thread #'some-fun)
> (some-other-fun)
>
> ... how do these threads interact with closure-var? Is there any
> protection? Should there be? (I suppose the usual fall-back for this
> kind of thing would be to say it's up to the programmer... the usual
> locking schemes would probably be used, but that assumes that the
> developer spawning the thread knows that there are dependencies between
> these two functions).
CLOUSURE-VAR is shared state and that is why there are synchronization
mechanisms (mutex and stuff). There is no protection.
Cheers,
Marco
More information about the Gardeners
mailing list