[Gc] [PATCH] define HANDLE_FORK on unix platforms with pthreads
Andy Wingo
wingo at pobox.com
Tue Feb 21 01:36:04 PST 2012
Thanks for the comments, Hans!
On Tue 21 Feb 2012 00:16, "Boehm, Hans" <hans.boehm at hp.com> writes:
> 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.
Can you cite this? I am having a hard time finding this one.
There is the issue of fork from signal handlers, as well, but that is a
separate issue:
http://standards.ieee.org/findstds/interps/1003-1c-95_int/pasc-1003.1c-37.html
> 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.
It seems that glibc does install atfork handlers for a number of
things. See for example:
http://repo.or.cz/w/glibc.git/blob?f=malloc/arena.c#l218
Also see other uses of "thread_atfork" internal to glibc.
Regards,
Andy
--
http://wingolog.org/
More information about the Gc
mailing list