[Issue 4307] spawn()'ed thread doesn't terminate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 1 02:41:23 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4307



--- Comment #3 from Jonathan M Davis <jmdavisProg at gmx.com> 2010-11-01 02:39:58 PDT ---
I think what's happening is that pthread_join() never gets called on a thread
started with spawn(), and IIRC, if pthread_join() never gets called on a
thread, it never actually terminates. The only place that I see pthread_join()
getting called is in Thread.join(), and that never gets called for threads
started with spawn(). What we really want here, I think, is for threads which
succesfully terminate to just join to their parent thread themselves without
the parent thread having to call join() on them, but I'm not sure that you can
really do that with pthreads. Assuming that the parent thread has to join() on
all threads created with pthread_create(), we're going to need to find a way to
get the parent thread to call join() on its spawned threads. About all I can
think of is to have a thread whose entire job is to create threads and and make
sure that they join. But it's been too long since I had to deal with pthreads
for me to remember all of the details.

In any case, I believe that the problem stems from the fact that the spawned
threads are never actually joined.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list