Linux.com

PID(process ID)

Link to this post 09 Nov 11

Hi, i'am a newbie in linux,
i want to ask something about process id,
linux is multiprogramming system, so independent user process may be running at the same time and with different user,
it's said that the value of PID(process id) is from 1 to 32768, i want to ask how if there is more than 32768 process in a computer, what the new value PID of new process, how linux kernel implement this??

thanks very much....

Link to this post 11 Nov 11

That's the OS limit. It can't handle more than that number of processes (AFAIK). It's not like you going to get to that many processes in one computer, are you? ;)

Regards

Link to this post 17 Nov 11

Very rarely would you exceed that many PIDs, however if the need comes up you can increase the maximum pids for the system, check http://www.cyberciti.biz/tips/howto-linux-increase-pid-limits.html for instructions.

Link to this post 17 Nov 11

Thanks, i think i get important information here,
is in kernel the systemcall use "sysctl -w kernel.pid_max=4194303" itself or other similar syscall so linux automatically expand the pid on demand?

and not a long time ago, i find :
*PIDs are converted to matching process descriptors using a hash function.
*A pidhash table maps PID to descriptor.
*Collisions are resolved by chaining.

Is "collision" above means process with same pid??
if not, what does it mean?

Sorry, if i ask much, but i really want to know more,
btw, thanks for your information before


Link to this post 17 Nov 11

Yes, that command will expand it on demand, but it is best to set the value at boot time. When I tried the command on my system it errored out, so I am assuming that something is wrong with my custom kernel that is blocking the command.

I think the document you are referring to is stating that it two processes have the same descriptors that the hash table uses a chain of values on the descriptor value to associate the processes. There should never be two processes with a single pid value.

Link to this post 17 Nov 11

Ouu, i see know, thanks, that's really a help,

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board