qfork() (The Spawn of spawn())

Bob Lenk rml at hpfcdc.fc.hp.com
Wed Jan 16 08:24:11 AEST 1991


Submitted-by: rml at hpfcdc.fc.hp.com (Bob Lenk)

In article <16895 at cs.utexas.edu> jfh at rpp386.cactus.org (John F Haugh II) writes:

> Again, the problem you are alluding to results from the choice of early
> or late allocation of paging space.  If you choose early allocation, you
> are correct - you can't fork() a 30MB process with only 20MB remaining.
> And yes, if you choose late allocation it is possible to deadlock, but
> only in the cases where you are doing more than you are with vfork().

This sounds like a good argument for two mechanisms, one with early
allocation and the other with late (or perhaps no) allocation.  If the
OS chooses blindly from a single interface (fork) it will sometimes
choose "wrong" according to the needs of the application.  There could
be an interface to select the behavior of fork() rather than two
separate calls; there are some advantages to each approach.

In what I've read in this discussion about qfork(), I'm nervous about
the spec that *nothing* is permitted between it and exec.  If nothing is
permitted portably, then a single spawn call should be defined.  The
whole advantage of separate calls is that things *can* be done in
between.  People will take advantage of this even if the standard calls
the behavior implementation-defined, unspecified, or undefined, and the
result is that people will write less-than-portable code.  If the
standard defines qfork(), I think it should define a useful set of
operations permitted with well-defined results in the child prior to
exec.

		Bob Lenk
		rml at fc.hp.com
		{uunet,hplabs}!fc.hp.com!rml

Volume-Number: Volume 22, Number 72



More information about the Comp.std.unix mailing list