is it good to make fork call from thread? how to handle termination of child forked by the thread?
is it good to make fork call from thread? how to handle termination of child forked by the thread?
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
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
> 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_doc...html#GEN-12013
Fuzzy memory from my Solaris hacking days
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.