Everything2
Near Matches
Ignore Exact
Full Text
Everything2

process id

created by quidfoabro

(thing) by da-x (4 wk) (print)   ?   (I like it!) Mon Jul 08 2002 at 18:52:06

A Process Identification Number, or 'pid', used to differentiate between processes in a multi-process computing environment.

For users:

When you run the common UNIX command 'ps', you get a list of processes and their respective pid numbers. With this information, you can perform actions such as killing processes, and sending them signals (using the 'kill' command).

In depth:

pid numbers in a UNIX system are usually positive integers of 15 bits. This gives them a range of 0-32767. pid numbers are assigned to processes in an incremental way. It means that a 'last assigned pid number' variable is kept in the system and upon the creation of new processes this variable gets incremented and the pid numbers are given to the new processes according to its value.

When a UNIX system boots, pid 1 is assigned to the first process, which is the init process. The system call used in UNIX to create processes is 'fork' (or sometimes 'vfork, 'clone'). init forks daemon programs, and these daemons get low pid numbers. After roughly 32767 forks, the pid assignment cycles back to 1, and processes are again being assigned with low pid numbers. Thus, a new process can be assigned with a pid of a previously dead process. On several systems, incremental increases are not a must. In fact several OSes choose them randomly for security reasons. On other systems, pid numbers lower than a certain limit are restricted to kernel-level threads.

Linux in particular: It has 15-bit pid numbers, though according to Linus Torvalds, there is no real problem to switch to 32-bit pid numbers, except for the uncertainty of how pid numbers should be handled in clustering environments. pid numbers lower than a certain limit are restricted to kernel-level threads, and on cycles the pid assignment variable resets to 300 instead of 1. In the Linux implementation, there is no difference between processes and threads, and each thread has it's own pid number. This is changing as recent kernels implement a better thread model, supporting lightweight processes.


printable version
chaos

Riding the clock question game SVCHOST.EXE init
.plan pid tty Advanced Unix Programming
renice session id DebPloit Signals
integer property $$ Howard Stern
kill orphan process permissions MOSIX
Installing Linux fuser thread kernel
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
After stirring Everything, these nodes rose to the top:
Jerusalem cricket
@
Sleeping with a great dane
Welcome to the Involuntary Agnostics Association
Haragei
The unkindness of ravens
coming out
Searching for signs of life in the bottom of a cup of cold coffee
Li Qingzhao's lingering fragrance
scrambled eggs
Oyster
Traci Lords
My regret sits on the floor like someone else's polaroid photos
New Writeups
Cuckowski
Slavonic Princess(poetry)
Heitah
Posthumous Oscar(thing)
ignis_glaciesque
University of South Florida(place)
ignis_glaciesque
Flogstaskriket(idea)
liveforever
Caesar's last breath(idea)
dagnyswaggart
she wants to believe(personal)
antigravpussy
he doesn't know, but her eyes widen too far(thing)
dagnyswaggart
Wild tides guard her secrets(poetry)
Lord Brawl
Caesar's last breath(poetry)
locke baron
Forgotten things in space(fiction)
sitaraika
Colours(idea)
etouffee
Wild tides guard her secrets(poetry)
Lord Brawl
Dr. Horrible's Sing-Along Blog(review)
a8ksh4
regret(idea)
Heisenberg
Editor Log: July 2008(log)
Everything 2 is brought to you by the letter C and The Everything Development Company