Is System V.4 fork reliable?

Doug Gwyn gwyn at smoke.BRL.MIL
Sun Jul 8 15:58:59 AEST 1990


In article <561 at oglvee.UUCP> jr at oglvee.UUCP (Jim Rosenberg) writes:
>The number of utilities that both use fork and also understand that under
>some circumstances it ought to be *retried* if it fails is pitifully small.

This is unfortunately true, but then so is the number of utilities that
understand that write() might successfully write fewer than the requested
number of bytes.

>(The shell simply reports the bogus message "No more processes".

Actually, the UNIX System V shells that I've encountered do keep retrying
the fork() operation for a while.  In fact, somewhere around SVR2.0 the
shell was changed to use an "exponential backoff" algorithm, i.e. the
delay between successive retries was doubled each time until some limit
was hit, at which time the shell would give up with "No more processes".
This algorithm, combined with a too-small per-user process limit, was
directly responsible for some UNIX System V vendors failing to pass the
operational demonstration in the large DA MINIS acquistion; because all
the "batch" scripts were executed under the same UID, several of them
quickly backed off to the point that they did not start running very
soon after the heavy load had subsided; basically the machine was idle
and the shells were sleeping like Rip van Winkle.



More information about the Comp.unix.wizards mailing list