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

Boehm, Hans hans.boehm at hp.com
Mon Feb 20 15:16:28 PST 2012


Sorry for not replying earlier.

I believe the reason this was not enabled by default is that Posix doesn't allow calling memory allocation functions such as malloc() between fork and exec either.  Thus AFAIK, this is a workaround for a problem not introduced by the garbage collector.

It may still be a good idea to turn it on.  I don't know whether glibc and malloc implementations normally try to handle this case correctly for standard malloc.  If they do, we probably we should as well.  But Posix-conforming code shouldn't rely on this one way or the other.

Hans

> -----Original Message-----
> From: gc-bounces at linux.hpl.hp.com [mailto:gc-bounces at linux.hpl.hp.com]
> On Behalf Of Andy Wingo
> Sent: Monday, February 20, 2012 1:27 PM
> To: Ivan Maidanski
> Cc: gc; Richard O'Keefe
> Subject: Re: [Gc] [PATCH] define HANDLE_FORK on unix platforms with
> pthreads
> 
> On Mon 20 Feb 2012 19:21, Ivan Maidanski <ivmai at mail.ru> writes:
> 
> > 1. I've committed your patch to master with some modifications. I
> > suppose this patch should be committed to "release" branch.
> 
> Excellent, thanks.  I didn't even think to check if pthread_atfork had
> a
> return value.  I'm not knowledgeable about Win32 or Cygwin, so I have
> no
> comments there.
> 
> Cheers,
> 
> Andy
> --
> http://wingolog.org/
> _______________________________________________
> 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