This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: ProcessManager on Solaris
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: David Daney <ddaney at avtrex dot com>
- Cc: Eric Botcazou <ebotcazou at libertysurf dot fr>, java at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Tue, 15 Feb 2005 20:32:46 -0500
- Subject: Re: ProcessManager on Solaris
- References: <200502152111.41174.ebotcazou@libertysurf.fr> <42125F44.3030604@redhat.com> <200502160029.48156.ebotcazou@libertysurf.fr> <42129EF6.5090104@avtrex.com>
David Daney wrote:
What happens if the SIGCHLD is received between the beginning of this
function and the thr_sigsetmask?
I am not a Solaris threads expert, but it looks like a race condition.
Since we initialize the GC explicitly during startup, the GC's daemon
thread will be created before any java.lang.Processes get created. I
suppose there is still theoretically a race however, if the mask isn't
set before starting the thread - although its pretty unlikely that a
java thread could get all the way through to creating and reaping a
process before the GC's daemon thread started to execute.
New threads are documented to inherit their signal mask from the
parent. Where is the Solaris equivalent of libjava/posix-threads.cc ?
The signal mask is set in there for posix-threads (look for calls to
block_sigchld() in _Jv_ThreadRegister and _Jv_ThreadStart.
libjava uses the regular POSIX threads on Solaris. As Hans mentioned, we
should migrate the boehm-gc to use the standard pthreads code on Solaris
too.
The reason why the mask isn't applied to the GC's daemon thread is that
we initialize the GC before we attach the main thread, so the signal
mask isn't applied to the main thread yet. An alternate solution would
be to make sure block_sigchld() gets called from the main thread before
_Jv_InitGC().
Bryce