Case 3 doesn't occur, since nobody uses fork().
The implicit thread is there for good reasons (signal handling breaks if it isn't there), and removing it is not an option.
/ Henrik Grubbström (Lysator)
Previous text:
2002-09-03 21:40: Subject: fork(): To be or not to be
Instead of digging up a suitable message to comment, I am posting this one. My opinion about fork is:
- It's unsafe with threads. Fine. It's disabled already when there
are threads. 2) It has uses, especially on platforms without threads. 3) It hasn't so far caused any of the imaginary problems mentioned here in previous threads (since the no-fork-when-threaded limitation was added at least).
Therefor I see absolutely no reason what-so-ever to remove it. Let it stay somewhere (in System, POSIX or but probably not the global scope).
Document it as dangerous, and point out that it simply doesn't work most of the case (due to explicit or implicit threads) and explain under what circumstances it does work.
This discussion has gone on too far with many unnecessary and stupid arguments whether or not fork() has a right to live. It harms no one, it's safe and it's here. Lets keep it and get on with things.
Also, is there no way of getting rid of that implicit thread used on many threaded platforms (without disabling threads completely)? What is the benefit of it exactly? I don't quite see the point of it since things obviously work fine without it. :-)
/ David Hedbor (I live in interesting times)