Is System V.4 fork reliable?

John F. Haugh II jfh at rpp386.cactus.org
Mon Jul 30 07:48:23 AEST 1990


In article <ZOY4ZO4 at xds13.ferranti.com> peter at ficc.ferranti.com (Peter da Silva) writes:
>In article <573 at oglvee.UUCP> jr at oglvee.UUCP (Jim Rosenberg) writes:
>> The larger question is *why can't the kernel sleep* when it needs more memory
>> for a fork???
>Even if it can't do it right then, it could check right before leaving
>kernel mode. Or if that's politically incorrect, change fork.o in libc.a
>to implement the check for EAGAIN and do an exponential backoff (or
>whatever).

It isn't that the kernel =can't= sleep, but rather that someone decided
[ for some totally random reason, I suspect ... ] that the kernel
=shouldn't= sleep.  The solution isn't to add some kludge on top of the
system, but rather to put back the behavior that was always there -
the kernel sleeps in fork if it requires additional memory.

In the past, the kernel swapped the process if malloc() didn't return
with space.  So, this is a change in function, not some defect in
application code.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org



More information about the Comp.unix.wizards mailing list