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 _______________________________________________ Gardeners mailing list [email protected] http://www.lispniks.com/mailman/listinfo/gardeners
