[Gc] Detect threading system used by the GC

Hans Boehm Hans.Boehm at hp.com
Mon Feb 13 08:46:45 PST 2006

Currently I don't think there isn't an easy way to do that.  I agree there
should be.  The installed gc.h is the same across all platforms.  Perhaps
the GNU-style "make install" should at least add a

#ifndef GC_xyz_THREADS
#  define GC_xyz_threads


At the moment, you can probably test whether threads are supported
in a configure script with a small test program that calls GC_gcollect()
from something other than the main thread.  I think that's guaranteed to
fail (probably with a SIGSEGV) if the GC doesn't support threads.
But I won't claim that's very clean.


On Mon, 13 Feb 2006, Stephane Epardaud wrote:

> Hello,
> Is it possible to detect the threading system for which the GC was compiled ?
> Say by looking at the installed headers or in the library ?
> I would need to know this in a configure script, to check that the GC was
> compiled for the pthreads (or even my own threads) but I'm not sure how I'm
> supposed to do that. It seems to me when including gc.h I need to define
> GC_LINUX_THREADS if the GC was compiled with pthreads, but isn't it possible to
> know whether or not the GC actually _was_ compiled with pthreads?
> Thanks
> --
> Cheers,
> Stéphane Épardaud
> INRIA Sophia-Antipolis
> France, EU
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> https://www.hpl.hp.com/hosted/linux/mail-archives/gc/

More information about the Gc mailing list