tech-userlevel archive

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

Re: Remote pid with SOCK_DGRAM local socket



On Sat, May 14, 2011 at 08:08:17PM +0000, David Holland wrote:
> On Sat, May 14, 2011 at 02:16:00PM +0100, David Laight wrote:
>  > Since NetBSD won't reuse a pid immediately, a slightly stale pid number
>  > is almost certainly not a problem.
> 
> ...for ever-decreasing values of "not immediately". It doesn't take
> that long to cycle through 32768 processes any more, and I think we're
> pretty soon going to have to take the plunge and go to 32-bit pids.

They are kept low because some emulations (which might just have
been killed) can only handle 16bit pids, and to reduce typing
when kiling processes (and probably for layout in ps and top).

If the system has a lot of active processes, then the pid numbers
will increase.

Might be worth allowing 24bits, I think this will increase the
number of forks before a pid can by reused by a factor of 256.
(Can't remember off hand what the minimum is at the moment.)

Linux systems still allocated 'next free pid' - so it is fairly easy
to guess the next number.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index