463 Subj : Re: pthreads and fork To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Sat Feb 19 2005 11:33 pm Marcin 'Qrczak' Kowalczyk writes: > Hmm, this suggests an interesting alternative semantics of ForkProcess: > before canceling all threads, wait until they all reach a point where > signals are enabled, and suspend each thread in that point until the > fork is done. Then in the parent process threads are resumed, while in > the child they are canceled. Oops, this would not work for threads which are just about to finish. It is reasonable for them to not unblock signals before finishing, and thus they would never handle the suspending signal, which would make them indistinguishable from threads which are busy doing something with signals blocked. Unless I also monitor whether they are exiting - this is getting complicated... So even if this semantics of ForkProcess would be nice, it happens to be hard to implement. -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ . 0