[armedbear-devel] Fwd: threads, join, clos

Erik Huelsmann ehuels at gmail.com
Sat Apr 24 08:57:08 UTC 2010


Sent mail to David personally; meant to include the list.


---------- Forwarded message ----------
From: Erik Huelsmann <ehuels at gmail.com>
Date: Sat, Apr 24, 2010 at 9:37 AM
Subject: Re: [armedbear-devel] threads, join, clos
To: David Kirkman <dkirkman at ucsd.edu>


Hi David,

On Sat, Apr 24, 2010 at 6:52 AM, David Kirkman <dkirkman at ucsd.edu> wrote:
> Hi,
>
> Is there an equivalent of java.lang.Thread.join() on the lisp side of
> things?  I looked around in LispThread.java and threads.lisp, but I
> don't see anything obvious.  I'd like to be able to write something
> like:
>
> (let ((threads (loop for i from 0 to 5
>                  collect
>                    (make-thread #'(lambda()
>                                     (format t "hey~%"))))))
>  (mapc #'thread-join threads)
>  (format t "is for horses~%"))
>
> I've attached a patch that implements this version of thread-join.  It
> implements java semantics, this thread-join always returns nil.

I guess we didn't join our threads until now :-) Thanks for taking the
time to code it up.

I have one question regarding the patch though: How would the caller
know the difference between the scenario where an Interrupted
exception occurs and the one where the thread is really joined?

Should we use the return value NIL to signal "not joined" and T for "joined"?

Bye,

Erik.




More information about the armedbear-devel mailing list