On Monday, July 17, 2006, at 02:58 pm, Marco Monteiro wrote:
> Duncan Rose wrote:
>> On Sunday, July 16, 2006, at 02:07 pm, Marco Monteiro wrote:
>>
>>
--->8--- snipped --->8---
>
>> 3. Not sure if it makes any difference whatsoever, but can the
>> functional argument to SPAWN-THREAD be a closure? (I'm not sure this
>> matters much either).
>
> (spawn-thread #'(lambda () (dostuff arg))
>
> is allowed. A lexical closure is a function. Is this what you are
> asking?
I was more thinking along the lines of:
(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).
I guess people might trip over this if using functions defined with
LABELS too.
Like I said, I don't know if this would / could cause problems, but
this was my thinking mainly.
-Duncan
>
>>
>> (Other than that?) the document looks reasonable to me (perhaps I
>> would
>> argue about some function names, but that is rather an irrelevance I
>> think).
>
> Which function names?
>
>>
>> -Duncan
>>
>>
>
> Thank you for your comments.
>
> Marco
>
> _______________________________________________
> Gardeners mailing list
> [email protected]
> http://www.lispniks.com/mailman/listinfo/gardeners
>
_______________________________________________
Gardeners mailing list
[email protected]
http://www.lispniks.com/mailman/listinfo/gardeners