[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] Why Attempt fork(2) up to Five Times?

From: Robert Elz
Subject: Re: [Nmh-workers] Why Attempt fork(2) up to Five Times?
Date: Sat, 09 Sep 2017 03:36:12 +0700

    Date:        Fri, 08 Sep 2017 15:57:27 +0100
    From:        Ralph Corderoy <address@hidden>
    Message-ID:  <address@hidden>

  | Ken wondered why we bother
  | with multiple attempts.  It's a good point.  Historically, they were
  | probably vfork(2), but even so...  If anyone knows a good reason then
  | pipe up promptly,

In modern systems, almost certainly pointless.

vfork() is unrelated - retrying a vfork() was never particularly useful.

Back in 6th edn unix days, it was quite common for fork() to fail on busy
systems (which was most of them) due to one limit being temporarily exceeded
or another (process table full, out of memory, ...)   Resources were in limited
supply back then, and simply retrying (often after a short sleep, though not
always required) would often end up succeeding, if some other process happened
to have exited in the meantime (sometimes even just exec'd).

It was very common back then to repeat failed fork() calls, particularly when
there was no easy other recovery mechanism available (an editor forking to
run a "!' command shell can just tell the user the fork failed, and allow
them to try again if they want, processes that need to fork without user
involvement really want the fork to work, if it can possibly be made to 

MH dates from 6th edition unix times, so ...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]