Subject: Re: new vfork(2) implementation
To: Wolfgang Solfrank <>
From: Todd Vierling <tv@NetBSD.ORG>
List: current-users
Date: 01/05/1998 14:57:58
On Mon, 5 Jan 1998, Wolfgang Solfrank wrote:

: > Is there any reason sh could be "fixed" to use vfork()?  Considering the
: > enormous number of scripts out there that use sh, this could be a big
: > performance gain. 
: Hmm, I know it's probably only me, but IMHO vfork _is_ a bug.

I know you're not the only one that feels that way, but I believe it isn't
for the following reasons:

- Not all machines are truthfully fast enough to make copying a bunch of
  copy-on-write pmap pages efficient.  Much less an entire process space
  like very old fork()s did.
- With vfork(), the page maps are created only once, as opposed to twice
  with fork().  (Once at fork time, once at exec time.)
- We don't have something more efficient like a function that forks and
  execs simultaneously.
- fork() is a sensationally old hack in itself.  So don't rag on vfork().

===== Todd Vierling (Personal; Business =====
== "There's a myth that there is a scarcity of justice to go around, so
== that if we extend justice to 'those people,' it will somehow erode the
== quality of justice everyone else receives."  -- Maria Price