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

Boehm, Hans hans.boehm at hp.com
Wed May 12 17:45:20 PDT 2004

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 ...
-----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
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.		*/
#    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.
Gareth Baker

More information about the Gc mailing list