Monday, 4 March 2013

Process States


A process goes through a series of discrete process states. The five general categories of process states are:
·        New
·        Ready
·        Running
·        Blocked
·        Terminated

Some authors are describes a process has four states (by eliminating New state).
The above five states are briefly explained below.
Process States
Process States

New
The process is being created. But not yet been admitted to the pool of executable processes by the operating system. Although its process control block has been created.

Ready
A ready process possesses all the resources needed for execution excepts the processor. The process is waiting to be assigned to a processor.

Running
The process that is currently being executed. On a single processor system, at most one process may be at running time at any point of time. The running process executes its sequence of instructions and may call on the operating system to perform services such as an I/O operation or synchronization via signal exchange.

Blocked/Waiting/Suspended
A process that cannot execute until some event occurs, such as the completion of an I/O operation, a synchronization signal etc. such processes are normally excluded from competition for executing until the suspending condition is removed.

Terminated
The process has finished execution.
  
At any time, a number of active processes occupy different states. The collective state of all processes and resources (busy, free) in the system is known as global system state.

In a system with single CPU, only one process may be running at any time but several processes may be ready and several processes may be blocked. Operating system keeps a ready list of ready processes and a blocked list of blocked processes.  

Next, we will discuss process scheduling. Process scheduling consists the following functions; scheduling, dispatching and context save. The scheduling function uses the information available in the PCBs of the processes and selects a process based on the scheduling policy.

      NEXT: Scheduling 
      Index : Operating System

No comments:

Post a Comment