bug-bash
[Top][All Lists]
Advanced

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

Re: AIX and Interix also do early PID recycling.


From: Michael Haubenwallner
Subject: Re: AIX and Interix also do early PID recycling.
Date: Thu, 26 Jul 2012 11:31:23 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20120113 Thunderbird/8.0


On 07/25/12 19:06, Chet Ramey wrote:
Well, _SC_CHILD_MAX is documented across platforms as:

Heck, even POSIX specifies CHILD_MAX as:
"Maximum number of simultaneous processes per real user ID."

Also, one Linux machine actually shows the _SC_CHILD_MAX value equal to
kernel.pid_max (32768 here),

That's interesting, since Posix describes sysconf() as simply a way to
retrieve values from limits.h or unistd.h that one wishes to get at
run time rather than compile time.  And interesting that it establishes a
correspondence between CHILD_MAX and _SC_CHILD_MAX.

There's this one sentence in sysconf spec:
  The value returned shall not be more restrictive than the corresponding
  value described to the application when it was compiled with the
  implementation's <limits.h> or <unistd.h>.

So CHILD_MAX is the /minimum/ value sysconf(_SC_CHILD_MAX) may return.

And I suspect that the single change of significance is to not check
against the childmax value when deciding whether or not to look for and
remove this pid from the list of saved termination status values.

Agreed - but is this still different to defining RECYCLES_PIDS then?

It is not.  It is one of the things that happens when you define
RECYCLES_PIDS.  The question is whether or not that is the single thing
that makes a difference in this case.  If it is, there is merit in
removing the check against js.c_childmax entirely or making it dependent
on something else.

IMO, checking against js.c_childmax (sysconf's value) still makes sense
to have some upper limit, while being large enough to be useful.
However, defining the "useful" value is up to the kernel, which does
guarantee for static CHILD_MAX (or _POSIX_CHILD_MAX) at least, while
providing more than 100 in practice across various platforms.

However, having the "useful" value unavailable to bash feels like
rendering the RECYCLES_PIDS-implementation mandatory for /any/ platform.

/haubi/



reply via email to

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