4 ms·
How many libraries do you use? Are you sure they don't create their own threads? Also, just imagine something like this: file.write(blah); if (has_fo
by dietrichepp 12y ago
How many libraries do you use? Are you sure they don't create their own threads?
Also, just imagine something like this:
file.write(blah);
if (has_forked) thread_exit();
file.write(blah2);
if (has_forked) thread_exit();
file.write(blah3)
if (has_forked) thread_exit();
Note the race conditions in the above code... forkall() is a disaster. Presumably you'd combine it with pthread_atfork(), but it's still a total mess.