News for hackers. Stuff that matters.
Re:Ask HN - Why was there ever, fork() ? by bediger on Tuesday October 06, 2009 @08:09AM (#863944)
fork() by itself - inelegant. fork() - do ARBITRARY stuff in child process - exec(), now that does all kinds of things that a spawn()-type process creation cannot do.

fork() allows the ability to do anything before exec(), setting up lighter-weight process creation, and whatever flexibility the programmer desires.

I'd turn it around: why do the designer's of spawn() or CreateProcess() think they've got the foresight to cover all of the bases for programmers? Why don't those systems do fork()/stuff/exec() to simplify?

Re:Ask HN - Why was there ever, fork() ? by jacquesm on Tuesday October 06, 2009 @08:27AM (#863964)
Why is fork by itself inelegant ?

Text editor, hit 'save', editor forks, saves in the background and quietly exits, no matter how long the save will take. Meanwhile the user continues to type in more text in the foreground.

Just one example.

Re:Ask HN - Why was there ever, fork() ? by makecheck on Tuesday October 06, 2009 @08:57AM (#864020)
"fork() allows the ability to do anything before exec()..."

That is not entirely true. See the "CAVEATS" section of "man fork".