[Gc] FW: Possible problem with gc6.3alpha5 version of collector (MacOS X)

Andrew Begel abegel at eecs.berkeley.edu
Wed May 12 17:54:27 PDT 2004


Does the MacOSX port of the GC even use the pthread suspend model to 
identify threads anymore? I only know about the stop-the-world scanning 
of the registers and stack, and that code uses Mach-specific calls to 
suspend threads.

Andy


On May 12, 2004, at 5:45 PM, Boehm, Hans wrote:

> This patch looks very reasonable to me.  However, since I don't 
> understand
> how this previously worked on MacOSX or exactly what broke, I'd 
> appreciate
> any comments from MacOSX experts ...
> Thanks.
> Hans
> -----Original Message-----
> From: Baker, GJ (Gareth) [mailto:G.J.Baker at dl.ac.uk]
> Sent: Monday, May 10, 2004 1:26 AM
> To: 'boehm at acm.org'
> Subject: Possible problem with gc6.3alpha5 version of collector
> Hi,
> I've been trying to get threading working on a C# compiler (pnet from
> dotgnu.org) which uses your garbage collector. To get threading 
> working I
> had to make a minor modification to gc_priv.h. The logic at the bottom 
> of
> this file which sets SIG_SUSPEND was causing an 'undefined variable
> SIGRTMIN' error when I compiled pnet on my MacOSX v10.3.3 system. A 
> bit of
> investigation indicated that SIGRTMIN is not defined anywhere in the 
> Mac OS.
> To get pnet to compile I had to add the following additional 
> preprocessor
> logic to gc_priv.h:
> # if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS)
>   /* We define the thread suspension signal here, so that we can 
> refer	*/
>   /* to it in the dirty bit implementation, if necessary.  Ideally 
> we	*/
>   /* would allocate a (real-time ?) signal using the standard 
> mechanism.*/
>   /* unfortunately, there is no standard mechanism.  (There is one 	*/
>   /* in Linux glibc, but it's not exported.)  Thus we continue to 
> use	*/
>   /* the same hard-coded signals we've always used.			*/
> #  if !defined(SIG_SUSPEND)
> #   if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
> #    if defined(SPARC) && !defined(SIGPWR)
>        /* SPARC/Linux doesn't properly define SIGPWR in <signal.h>.
>         * It is aliased to SIGLOST in asm/signal.h, though.		*/
> #      define SIG_SUSPEND SIGLOST
> #    else
>        /* Linuxthreads itself uses SIGUSR1 and SIGUSR2.			*/
> #      define SIG_SUSPEND SIGPWR
> #    endif
> #   else  /* !GC_LINUX_THREADS */
> #     if defined(_SIGRTMIN)
> #       define SIG_SUSPEND _SIGRTMIN + 6
> /********************************************* ADDITIONAL CODE */
> #     elseif defined (SIGRTMIN)
> #       define SIG_SUSPEND SIGRTMIN + 6
> #     else
> #       define SIG_SUSPEND SIGUSR1
> /********************************************* END */
> #     endif
> #   endif
> #  endif /* !SIG_SUSPEND */
> I did try a Mac specific 'if defined(GC_DARWIN_THREADS)' but it did 
> not seem
> to work - perhaps I got the logic wrong!
> Hope this may be of some use.
> Regards
> Gareth Baker
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/



More information about the Gc mailing list