Unix fork()

Chris Bitmead uid(x22068) Chris.Bitmead@Alcatel.com.au
Tue, 06 May 1997 10:24:13 +1000

>For example, such a system could have a given execution threads object's
>scattered all over the place, not in a single address space, so fork() is
>non trivial.  However, fork() is usually just a kludge for the 
>oversight in Unix, the need for a spawn().  Generally, when people use 
>fork() they intend to exec() something right away.  In this case, why
>copy the entire process just to replace it?  

I don't know if this is relevant to the discussion, but calling fork()
does not copy the entire process, it just gives the illusion of

Also, fork is not a kludge for the oversight of spawn(). The reason
for fork is so that you can make arbitrary alterations to the process
state in between calling fork and exec, not to mention the fact that
you don't always call exec. There are many situations in which you
just want to fork.