This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: GCJ built multithreaded program keeps creating zombies
- From: Tom Tromey <tromey at redhat dot com>
- To: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- Cc: gcc-bugs at gcc dot gnu dot org, <aeby at graeff dot com>
- Date: 18 Dec 2002 18:13:24 -0700
- Subject: Re: GCJ built multithreaded program keeps creating zombies
- References: <Pine.LNX.4.44.0212181758580.15269-100000@gandalf.ticam.utexas.edu>
- Reply-to: tromey at redhat dot com
>>>>> "Wolfgang" == Wolfgang Bangerth <bangerth@ticam.utexas.edu> writes:
[ Wolfgang, I didn't meant to cut off the CCs in my earlier reply.
Here it is again, with CCs preserved. ]
Wolfgang> OK, I see, you set a mutex on exit of the new thread, and in
Wolfgang> join() you just wait to get it. Is this right?
Close. In Thread.join we wait on a condition variable. When a thread
dies it signals this variable and all listeners wake up.
Wolfgang> Then on Linux you will create a zombie for every thread you
Wolfgang> create.
But empirically this doesn't happen, because we create non-joinable
threads. In fact if we tried to join them, pthread_join would just
return an error (unless Linux egregiously violates POSIX or X/OPEN
here).
Wolfgang> Unfortunately, I can't find the place where you actually
Wolfgang> create a new thread right away...
_Jv_ThreadStart in libjava/posix-threads.cc.
Tom