[Top][All Lists]

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

Re: AIX and Interix also do early PID recycling.

From: Chet Ramey
Subject: Re: AIX and Interix also do early PID recycling.
Date: Wed, 25 Jul 2012 11:33:05 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

On 7/25/12 10:11 AM, Michael Haubenwallner wrote:
> On 07/25/2012 02:14 PM, Greg Wooledge wrote:
>> On Wed, Jul 25, 2012 at 09:59:28AM +0200, Michael Haubenwallner wrote:
>>> OTOH, AFAICT, as long as a PID isn't waitpid()ed for, it isn't reused by 
>>> fork().
>>> However, I'm unable to find that in the POSIX spec.
>> A process that hasn't been waited for should become a zombie, which
>> should be sufficient to prevent its PID being reused.  Are you saying
>> that AIX and Interix don't have zombies?
> Nope. My thought was that bash eventually could postpone waiting for a 
> specific
> child PID until required by the driving shell script. That is: immediately for
> synchronous childs to set $?, and on "wait" for asynchronous childs. The idea
> was to render storing CHILD_MAX returnvalues obsolete.

It won't; Posix makes it required.  However, Posix does allow shells to
detect when $! is referenced and not save that many termination statuses
if it's not.  The problem is as I explained in a previous message: you
have processes you have to reap whether or not the script calls `wait'.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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