PDA

View Full Version : Forking from thread



vipul_vgp
02-27-2009, 01:16 AM
is it good to make fork call from thread? how to handle termination of child forked by the thread?

matsp
02-27-2009, 04:25 AM
The new process will have only one thread, a copy of the one that did fork in itself. All other threads won't exist in the new process.

I have no idea what you mean by "termination of child forked by the thread" - it will send the same SIG_CHILD signal, and wait/wait_pid() etc will work just like in any other situation.

--
Mats

Salem
02-27-2009, 12:47 PM
> The new process will have only one thread, a copy of the one that did fork in itself.
I thought this was wrong (from memory), but then I found this.
http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWdev/MTP/p36.html#GEN-12013

Fuzzy memory from my Solaris hacking days ;)