Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!gatech!ncsuvx!mcnc!rti!xyzzy!bert!throopw From: throopw@bert.dg.com (Wayne A. Throop) Newsgroups: comp.os.minix Subject: Re: fork Message-ID: <3927@xyzzy.UUCP> Date: 8 Mar 89 20:21:00 GMT References: <1989Mar3.174924.977@utzoo.uucp> <85830@felix.UUCP> Sender: usenet@xyzzy.UUCP Lines: 35 > preston@felix.UUCP (Preston Bannister) >> henry@utzoo.uucp (Henry Spencer) (paraphrased by Wayne Throop) >> [... there is many a dup() 'twixt fork() and exec() ...] > What I _meant_ (as opposed to what I said :-) was that fork() calls are > almost always followed very closely by exec(). The point I am trying to > make is that the child-is-copy-of-parent semantic of fork() is irrelevant to > _most_ programs. [... and vfork() better represents real needs ...] Well.... no. Vfork does nothing that a properly implemented fork can not do (that is, essentially nothing aside from the copying of the data that the child actually faults on for writing). Vfork was a self-admited kludge introduced because the VM system of some version of the BSD lost in the mists of time didn't do an adequate job in supporting fork. On the other hand, I agree that it *might* be a good thing to support a non-copying-semantic method of process creation. It's just that the interaction of vfork() with exit() and exec() is bogus, and a much more excellent method would be to have push/pop of file descriptor and signal state operations, along with a create-process operation. This would give the advantages of vfork (that is, efficency with inadequate or overly simple VM implementations) without the appearance of klugery. On the other hand, we've just added three system calls to handle a case which is just a subset of the possibilites given by appropriate use of fork() and exec(). Leave aside the fact that the case covered by the three additional systems calls is the most common... it's still pretty clear that fork() + exec() is exactly the right division of responsibility if what you want is neat, sweet, and petite. -- Have you heard of the wonderful one-hoss shay, That was built in such a logical way It ran a hundred years to a day? --- Oliver Wendell Holmes -- Wayne Throop !mcnc!rti!xyzzy!throopw