in reply to Re: To thread or not to thread
in thread To thread or not to thread
Really? When?
Butenhof warns against it ... "avoid using fork in a threaded program (if you can) unless you intend to exec a new program immediately". (Programming w/ POSIX Threads p197).
There are lots of complications associated with it. In pthreads, only the thread that calls fork exists in the parent. But it does have a copy of all the mutexes etc that existed in the parent. So you must define a 'fork handler' which allows you to do certain cleanup at the time the fork happens (in the parent and the child).
I think it would be a case of mixing fairly incompatible paradigms ...
--
Ash OS durbatulk, ash OS gimbatul,
Ash OS thrakatulk, agh burzum-ishi krimpatul!
Uzg-Microsoft-ishi amal fauthut burguuli.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: To thread or not to thread
by Aristotle (Chancellor) on May 30, 2002 at 14:39 UTC |