This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCJ built multithreaded program keeps creating zombies


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]