Subject: Re: new pid allocation code
To: David Laight <>
From: Bill Studenmund <>
List: tech-kern
Date: 03/11/2003 09:41:10
On Tue, 11 Mar 2003, David Laight wrote:

> The basic idea is to ensure that you allocate a pid number which
> references an empty slot in the lookup table.  To do this a FIFO freelist
> is linked through the free slots of the lookup table.
> To avoid reusing pid numbers, the top bits of the pid are incremented
> each time the slot is reused (the last value is kept in the table).
> If the table is getting full (ie a pid would be reused in a relatively
> small number of forks), then the table size is doubled.
> Orphaned pgrps correctly stop the pid being reused, orphaned sessions
> keep the pgrp allocated.

Sounds like how AIX does process #s.

What is the layout of how you use bits in a PID?

Take care,