This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Concurrency semantics of fork


On 11/09/2015 06:41 PM, Carlos O'Donell wrote:
Assume a lockless malloc implementation and then fork. What guarantees does
the child have with regards to the state of the structures in such a malloc
implementation?

POSIX explicitly says that you can't make any assumptions about the
state of a multi-threaded application after calling fork.  Thus you're
only allowed to call async-safe functions between fork and one of the
exec functions.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html
http://www.linuxprogrammingblog.com/threads-and-fork-think-twice-before-using-them

--
========================================================================
Ian Pilcher                                         arequipeno@gmail.com
-------- "I grew up before Mark Zuckerberg invented friendship" --------
========================================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]