[Gc] [PATCH] define HANDLE_FORK on unix platforms with pthreads

Andy Wingo wingo at pobox.com
Sat Feb 18 12:56:23 PST 2012

On Fri 17 Feb 2012 21:45, Ivan Maidanski <ivmai at mail.ru> writes:

> It seems you're proposing the right thing but I guess your patch could
> break build for some targets (there are some many Unix targets supported
> like xBSD, RTEMS, NaCl, Android, Darwin, DG/UX, HP/UX, Aix, Irix,
> Solaris... - does at least pthread_atfork exist everywhere?

I don't know.  It's from the SUSV2 standard, released in 1997.  I would
think it's fairly portable, but I really don't know.  The bigger problem
is that that part of libgc probably isn't as tested.  It does seem to be
the right thing, though -- as much as there can be a right thing, when
you are combining threads, gc, and fork() ;-)

If we want to restrict this to e.g. glibc targets, that's fine; though,
there is no inherent reason why this couldn't work on other POSIX
platforms as well.



More information about the Gc mailing list