Jump to content

Process state

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by GeorgeBills (talk | contribs) at 07:58, 14 March 2006 (New page ==> information on the various states that processes can be in). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In a multitasking computer system, processes may occupy a variety of states. These states are abstractions in that the operating system kernel may not actually recognize them as distinct states for the process, however they are a useful abstraction for the understanding of processes.

Created (aka: new)

When a process is first created, it occupies the "created" or "new" state. In this state, the process awaits admission to the "ready" state. This admission will be approved or delayed by a long-term, or admission, scheduler. Typically in most desktop computer systems, this admission will be approved automatically, however for real time operating systems this admission may be delayed. In a real time system, admitting too many processes to the "ready" state may lead to oversaturation and overcontention for the systems resources, leading to an inability to meet process deadlines.

Ready (aka: waiting)

A "ready" or "waiting" process has been loaded into main memory and is awaiting execution on a CPU (to be context switched onto the CPU by the dispatcher, or mid-term scheduler). There may be many ready processes at any one point of the systems execution - for example, in a one processor system, only one process can be executing at any one time, and all other "concurrently executing" processes will be waiting for execution.

Running (aka: active, executing)

A "running" or "active" process is a process which is currently executing on a CPU. From this state the process may exceed its allocated time slice and be context switched out and back to "ready" by the operating system, it may indicate that it has finished and be terminated or it may block on some needed resource (such as an IO resource) and be moved to a "blocked" state.

Blocked

Should a process "block" on a resource (such as a file, a semaphore or a device), it will be removed from the CPU (as a blocked process cannot continue execution) and moved to the blocked state. The process will remain "blocked" until its resource becomes available, which can unfortunately lead to deadlock. From the blocked state, the operating system may notify the process of the availability of the resource it is blocking on (the operating system itself may be alerted to the resource availability by an interrupt). Once the operating system is aware that a process is no longer blocking, the process is again "ready" and can from there be dispatched to its "executing" or "running" state, and from there the process may make use of its newly available resource.

Terminated

A process may be terminated, either from the running state by finishing its execution, or by being explicitly killed. In either of these cases, the process moves to the terminated state.

See also