Re:Memory FAQ
by gpderetta on Tuesday October 11, 2016 @08:26AM
(#12683692)
It is specified by POSIX and SUSv4 [1], but it still hard to use safely. Only the forking thread will exist in the child process; assume that mutexes are in an unspecified state, including those you do not know about (for example those inside libc malloc).
Friends do not let friends fork in a multithreaded process. Prefork before spawning any threads if required.
Friends do not let friends fork in a multithreaded process. Prefork before spawning any threads if required.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/