home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.22 / text0068.txt < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.3 KB  |  31 lines

  1. Submitted-by: richard@aiai.ed.ac.uk (Richard Tobin)
  2.  
  3. In article <16895@cs.utexas.edu> jfh@rpp386.cactus.org (John F Haugh II) writes:
  4. >Any scenario where I do modify a page is unsuitable for vfork(), so there
  5. >is no room for comparision of the merits of fork() with vfork().
  6.  
  7. Most programs that use vfork() change the values of variables in the
  8. child.  This is perfectly reasonable, so long as the parent doesn't
  9. rely on the value of those variables.
  10.  
  11. Of course, these programs don't usually change many variables, so a
  12. copy-on-write fork() won't need many pages in this case.  A c-o-w    
  13. fork() with late allocation of pages could could be as robust as
  14. vfork() almost always by pre-allocating a few pages.
  15.  
  16. Surely the problem is when it's being used as a *real* fork(), and the
  17. program fails much later when it modifies one variable too many.
  18.  
  19. I prefer to think of vfork() as being a way to save a process's kernel
  20. state - file descriptors etc - and having that state automatically
  21. restored when an exec() is done.
  22.  
  23. -- Richard
  24. -- 
  25. Richard Tobin,                       JANET: R.Tobin@uk.ac.ed             
  26. AI Applications Institute,           ARPA:  R.Tobin%uk.ac.ed@nsfnet-relay.ac.uk
  27. Edinburgh University.                UUCP:  ...!ukc!ed.ac.uk!R.Tobin
  28.  
  29. Volume-Number: Volume 22, Number 70
  30.  
  31.