Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcnc!rti!xyzzy!throopw From: throopw@xyzzy.UUCP (Wayne A. Throop) Newsgroups: comp.unix.questions Subject: Re: Fork and Join, Pipe in C Message-ID: <117@xyzzy.UUCP> Date: Sat, 27-Jun-87 13:59:40 EDT Article-I.D.: xyzzy.117 Posted: Sat Jun 27 13:59:40 1987 Date-Received: Sun, 28-Jun-87 04:47:37 EDT References: <7737@brl-adm.ARPA>, <1186@ius2.cs.cmu.edu> <8174@utzoo.UUCP> <21685@sun.uucp> <113@xyzzy.UUCP> Organization: Data General, RTP NC. Lines: 34 > throopw@xyzzy.UUCP (Wayne A. Throop) > [...] vfork is a horrible kludge. What *should* have > been coined is the ability to create a process running a new executable > image in a single system call. This is the only way the kernel can be > *assured* (rather than simply having it hinted at) that this process > creation will not involve the copying of any memory from the parent > process. Another way to reinforce this point just occured to me, and that is to point out a case where (I think) Berkeley got it right (though perhaps for other reasons). There is a close analogy to fork(), exec(), and create_process() in link(), unlink(), and rename(). Obviously, link() and unlink() in combination suffice to rename files. But some extra efficency (though, granted, I think efficency was not the major consideration) can be added by hinting to the kernel that an unlink() will follow the link() (avoiding the necessity to change the link count and so on) by introducing the system call vlink(). This would create a link() but not increment the link count, allowing the new link to "share" one of the existing ones, because one of them is about to go away. Happily, the Berkeley implementors didn't do that. They implemented rename() instead. And similarly, they should have implemented create_process() instead of vfork(). (Or did rename() come from NFS? Hmmmm. Now I'm confused. But the point remains valid in either event.) -- Adam and Eve had many advantages, but the principal one was, that they escaped teething. --- Pudd'nhead Wilson's Calendar (Mark Twain) -- Wayne Throop !mcnc!rti!xyzzy!throopw