[M3devel] cvsup

Daniel Solaz m3 at sol42.com
Tue Mar 16 22:19:26 CET 2010


On 16 Mar 2010, at 20:32, Tony Hosking wrote:
> fork should still work with pthreads.  Why wouldn't it?
Chapter 6.1 of Butenhof's pthreads book deals with this, and well, it is a mess.  According to him only the calling thread exists on return from fork() in the child process, but the other pthread *states* (mutexes, conditions, data keys, etc.) are replicated as well.  And I'm sure the details vary from system to system.
This is the chapter's first sentence: "Avoid using fork in a threaded program (if you can) unless you intend to exec a new program immediately."
Regards.
-Daniel


More information about the M3devel mailing list