Subj : Re: pthreads and fork To : comp.programming.threads From : ptjm Date : Sat Feb 19 2005 10:09 pm In article <87fyzszl48.fsf@qrnik.zagroda>, Marcin 'Qrczak' Kowalczyk wrote: % fork is supposed to leave only the calling thread in the child % process. What should happen with pthread_t values and the memory % associated with other threads? Is it legal to call pthread_join % after fork on a pre-fork thread? % % I imagine one of the following is true: But none of them are, although 3 is close. What happens is that all the memory of the caller is copied, the thread of execution which called fork() continues to run, and only async-signal safe functions may be called prior to calling exec. In practice, some people try to mix traditional forked processes with multi-threading, but it's fiddly and seems a bit pointless. -- Patrick TJ McPhee North York Canada ptjm@interlog.com .