Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!samsung!know!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!sun-barr!ccut!titcca!cc.titech.ac.jp!necom830!mohta From: mohta@necom830.cc.titech.ac.jp (Masataka Ohta) Newsgroups: comp.arch Subject: Re: vfork() and swap space allocation Message-ID: <5892@titcce.cc.titech.ac.jp> Date: 19 Jul 90 07:22:35 GMT References: <5813@titcce.cc.titech.ac.jp> <2699E08D.117A@tct.uucp> <5844@titcce.cc.titech.ac.jp> <269DBEFB.583C@tct.uucp> Sender: news@cc.titech.ac.jp Organization: Tokyo Institute of Technology Lines: 45 In article <269DBEFB.583C@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: >My favorite Unix is SCO Xenix/386 2.3. I haven't experimented with >its behavior under memory and swap space exhaustion. Then, what can you say about the subject? >I'm sure, >however, that a SCO person will know how it works and can followup >with that information. So far, no. >The Unix philosophy of resource usage is: "Pay as you go." Files are >not pre-allocated, but dynamically extended. The data segment is not >pre-allocated, but grows and shrinks on demand. Given this >philosophy, the only consistent treatment of swap space is to allocate >it when it is needed, and not before. The more important philosophy of resource usage of UNIX is: "Don't pay at all if not necessary." For example, no blocks will be allocated in holes of a file (due to seek). Vfork is another example. >>With vfork, such a situation never occur (except for stack segment), >>becasue fork is denied. >Note the "except" clause. Mr. Masataka himself here points out that >vfork() is an incomplete solution, since a kernel with vfork() must be >prepared to deal gracefully with swap space exhaustion due to stack >modification. Vfork is a complete and elegant solution for the forking problem. Problem of stack segment is the other problem which should be solved separately. Moreover, a solution exists. I will explain it if you are interested in. >So vfork() does not eliminate the swap space contention >inherent in new process creation. Vfork totally eliminate the swap space contention in new process creation to exec. Masataka Ohta