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

  1. Submitted-by: jfh@rpp386.cactus.org (John F Haugh II)
  2.  
  3. In article <16873@cs.utexas.edu> mohta@necom830.cc.titech.ac.jp (Masataka Ohta) writes:
  4. >You should also know that copy-on-write fork(), unlike vfork(), is inherently
  5. >buggy and can not be a general-purpose useful memory management mechanism.
  6.  
  7. You are confusing theory with implementation.  There is nothing "inherently"
  8. buggy with either vfork() or copy-on-write fork().  vfork() is fairly
  9. inflexible, and as pointed out by other writers, completely superfluous
  10. given a properly implemented fork().
  11.  
  12. >If you have 50MB swap space and want to fork() 30MB process to exec less
  13. >than 1MB shell, you can't. With COW fork(), there is workaround. But the
  14. >workaround is so incomplete that the system sometimes deadlocks.
  15.  
  16. Again, the problem you are alluding to results from the choice of early
  17. or late allocation of paging space.  If you choose early allocation, you
  18. are correct - you can't fork() a 30MB process with only 20MB remaining.
  19. And yes, if you choose late allocation it is possible to deadlock, but
  20. only in the cases where you are doing more than you are with vfork().
  21. Thus your complaint is simply invalid.  If I modify no pages between
  22. fork() and exec() with late allocated COW fork(), I will =never= run
  23. out of page space simply because I required no additional pages.  Any
  24. scenario where I do modify a page is unsuitable for vfork(), so there
  25. is no room for comparision of the merits of fork() with vfork().
  26.  
  27. >Thus, fork(), even COW fork(), is not a proper mechanism to fork-exec
  28. >other processes.
  29.  
  30. If you wish to describe some operation which is a simple fork-exec
  31. then you are correct.  However, process creation frequently involves
  32. more than forking and execing a new command.  It often involves the
  33. creation of IPC mechanisms (pipes, etc), signal manipulation, I/O
  34. redirection, ad nauseum.
  35. -- 
  36. John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
  37. Ma Bell: (512) 832-8832                           Domain: jfh@rpp386.cactus.org
  38. "While you are here, your wives and girlfriends are dating handsome American
  39.  movie and TV stars. Stars like Tom Selleck, Bruce Willis, and Bart Simpson."
  40.  
  41. Volume-Number: Volume 22, Number 67
  42.  
  43.