nmh-workers
[Top] [All Lists]

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

2017-09-08 15:37:49
    Date:        Fri, 08 Sep 2017 15:57:27 +0100
    From:        Ralph Corderoy <ralph@inputplus.co.uk>
    Message-ID:  <20170908145727.A7D571FE27@orac.inputplus.co.uk>

  | 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 
happen.)

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

kre



_______________________________________________
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>