ProcessManager on Solaris

Bryce McKinlay mckinlay@redhat.com
Wed Feb 16 07:05:00 GMT 2005


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /