[Gc] [PATCH] define HANDLE_FORK on unix platforms with pthreads
Andy Wingo
wingo at pobox.com
Tue Feb 21 02:37:43 PST 2012
On Tue 21 Feb 2012 10:36, Andy Wingo <wingo at pobox.com> writes:
> 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.
I found it:
A process shall be created with a single thread. If a multi-threaded
process calls fork(), the new process shall contain a replica of the
calling thread and its entire address space, possibly including the
states of mutexes and other resources. Consequently, to avoid errors,
the child process may only execute async-signal-safe operations until
such time as one of the exec functions is called.
Humm, indeed.
Andy
--
http://wingolog.org/
More information about the Gc
mailing list