Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!dptg!lzaz!hutch From: hutch@lzaz.ATT.COM (R.HUTCHISON) Newsgroups: comp.unix.questions Subject: Re: Using vfork() -vs fork() Message-ID: <748@lzaz.ATT.COM> Date: 22 Aug 89 13:00:43 GMT References: <3161@cbnewsh.ATT.COM> Organization: AT&T ISL Lincroft NJ USA Lines: 30 From article <3161@cbnewsh.ATT.COM>, by dwc@cbnewsh.ATT.COM (Malaclypse the Elder): > > in unix system v release 4, fork will have all the advantages > of vfork with none of the disadvantages (well almost). > > danny chen > att!hocus!dwc I think that SVR3 has these advantages already plus more. V.3 has copy-on-write (COW) pages, allowing parent and child to change the same image (by default). So, if the child does an exec() right away, the two are similar (in the amount of work the OS has to do). But... V.3 has extra goodies... 1) The SVR3 child does not have to obey the rules a vfork() child does - it can change the process image - whenever a change is made, the changing process (whomever it might be) gets its own copy of the page it changed - the rest remains shared. If a parent creates several children (through fork()s) they will all share the same image until one of them wants to change a page - then it will get its own copy and the rest will still share the original page. 2) Unrelated processes share data pages as well as (the traditional) text pages. This is great if you have large static tables - they are shared by all using the program. The same COW principle applies. Is there more that I'm missing? Bob Hutchison att!lzaz!hutch