This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: ProcessManager on Solaris


I'm not opposed to adding a hook to the generic collector code, so that
any hidden threads created by the GC can call back into gcj code to
do this sort of stuff.

The problem with the patch here is that I expect we will have the same
problem with the parallel GC threads, if anyone builds with
--enable-parallel-mark.  And I would expect that to become the default
a couple of years down the road when we all have multi-core chips in
our desktops.

In contrast, I'm trying to get rid of the Solaris-specific code.
Any problems/patches there are likely to be somewhat temporary.

Hans

> -----Original Message-----
> From: java-patches-owner@gcc.gnu.org 
> [mailto:java-patches-owner@gcc.gnu.org] On Behalf Of Bryce McKinlay
> Sent: Tuesday, February 15, 2005 4:23 PM
> To: Eric Botcazou
> Cc: java-patches@gcc.gnu.org
> Subject: Re: ProcessManager on Solaris
> 
> 
> Eric Botcazou wrote:
> 
> >>It should be pretty trival to fix boehm-gc to block 
> SIGCHLD. Basically 
> >>you should just need to copy the pthread_sigmask() code from 
> >>block_sigchld in posix-threads.cc into GC_pthread_create in 
> >>solaris_pthreads.c. I think it would be fine to make that change in 
> >>order to fix this problem, so please submit a patch.
> >>    
> >>
> >
> >Indeed, if I'm allowed to directly patch Boehm GC, the fix 
> is trivial.
> >Attached, tested on SPARC64/Solaris 9.
> >
> >
> >2005-02-16  Eric Botcazou  <ebotcazou@libertysurf.fr>
> >
> >	* solaris_threads.c (GC_thr_daemon): Block SIGCHLD.
> >
> >
> >  
> >
> >-------------------------------------------------------------
> -----------
> >
> >Index: solaris_threads.c
> >===================================================================
> >RCS file: /cvs/gcc/gcc/boehm-gc/solaris_threads.c,v
> >retrieving revision 1.12
> >diff -u -p -r1.12 solaris_threads.c
> >--- solaris_threads.c	16 Aug 2004 16:32:26 -0000	1.12
> >+++ solaris_threads.c	15 Feb 2005 23:09:05 -0000
> >@@ -743,7 +743,13 @@ void * GC_thr_daemon(void * dummy)
> >     register GC_thread t;
> >     register int i;
> >     register int result;
> >-    
> >+    sigset_t mask;
> >+
> >+    /* Libgcj's ProcessManager requires that SIGCHLD be 
> delivered to it. */
> >+    sigemptyset (&mask);
> >+    sigaddset (&mask, SIGCHLD);
> >+    thr_sigsetmask (SIG_BLOCK, &mask, NULL);
> >+
> >     for(;;) {
> >       start:
> >         result = thr_join((thread_t)0, &departed, &status);
> >  
> >
> 
> Its might be worth surrounding this with:
> /* GCJ LOCAL */
> and
> /* END GCJ LOCAL */
> 
> just to mark this as a deliberate divergance and avoid merge 
> confusion 
> later.
> 
> Otherwise, ok to commit.
> 
> Thanks
> 
> Bryce
> 
> 


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