Operating System - Linux
1752730 Members
5658 Online
108789 Solutions
New Discussion юеВ

Re: How LINUX OS picks the PID

 
SOLVED
Go to solution
skt_skt
Honored Contributor

How LINUX OS picks the PID

RHEL AS

I happened to trace a Oracleprocess which is suppose to be terminating at a particular time. I am not sure if a new process can come up with same PID of an "old process"
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: How LINUX OS picks the PID

Shalom,

The OS maintains a table, and hands out PID sequentially.

It is very unlikely for the new process to pick up the same PID as the old.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ivan Ferreira
Honored Contributor
Solution

Re: How LINUX OS picks the PID

The pid assignment process wraps at 32767.

$ cat /proc/sys/kernel/pid_max
32768

Next time around, the kernel skips over any
pids that are still in use from the last round of assignment.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Dennis Handly
Acclaimed Contributor

Re: How LINUX OS picks the PID