Re:Fork() without exec() is dangerous in large programs (2016)
by ncmncm on Tuesday June 14, 2022 @02:55PM
(#31744248)
A huge number of tricky thread problems go away if the child thread is blocked at startup, and allowed to run only after the parent allows it. To retrofit this, it is easiest to lock a mutex before spawning and have the child block on that. Then the parent unlocks it to let the child run.
[ Parent
| on HN ]
Re:Fork() without exec() is dangerous in large programs (2016)
by lanstin on Tuesday June 14, 2022 @05:21PM
(#31746253)
I think shared libraries can spawn threads on their load/init phase that you don't know about. Then you are hosed but you only know about it due to sporadic weird problems, that if you restart on failure, e.g. a pre-forked worker scenario, you might never even really care about.