ITEM: S8987L

Can you predict PIDs?


Response:

Env:

AIX 3.2.5

Desc:

Customer would like to know how process IDs (PIDs) are determined
and if the next PID can be determined.

Action:

The max PID is 2\^17 or 131072 as indicated in 
/usr/include/sys/proc.c. Testing showed sequential pids for a series
of commands and then a skip. (eg. 11000, 11001, 11002, 11003, 8946,
8947, 8948, ...)

Thinking about this, even if there were a way to determine what PID
came next, on a multi-user system there would be no way to insure
that your process would get that PID.  Another users' process could 
snag that PID. 

It comes down to this: at reboot, init gets PID = 1. After that, 
you cannot ACCURATELY determine the next PID.  AIX will look 
for an unused ID in the process table and assign it to the next 
process.


Support Line: Can you predict PIDs? ITEM: S8987L
Dated: April 1995 Category: N/A
This HTML file was generated 99/06/24~13:30:36
Comments or suggestions? Contact us