When a computer program runs but only a part of a program is running performing a specific task. This smallest unit of a program in execution is called a process. Technically, a process is not the smallest unit but some programs consist of threads which are smaller than a process.
When there is no process then the state is null. However, when a process is created then it changes many states during its lifetime. The state information for a process is kept in a Process Control Block (PCB).
New State – The process is created recently.
Running State – The process is being executed currently.
Waiting State – Waiting for some Event or Input/Output to finish, etc.
Ready State – Just before being assigned to a processor.
Terminated – The process finished execution.
Process State Diagram
The figure above shows that process change states due to various reasons and here is a list of transitions that happen between processes. Not necessarily in the same order.
Null -> New
New -> Ready
Ready -> Running
Running -> Terminated
Running -> Blocked
Blocked -> Ready
Running -> Ready
Ready -> Terminated
Waiting -> Terminated
Note – Running – Ready (This happens when process is removed from running due to a scheduling algorithm such as Round Robin, Priority Queue)
Process is program in execution and does specific task. The process changes may states during it’s life time and the final state for a process is Terminated state when it exits and no longer available in memory.
Abraham Silberschatz, Peter B. Galvin, Greg Gagne (July 29, 2008) Operating System Concepts, 8 edn., : Wiley.
Tanenbaum, Andrew S. (March 3, 2001) Modern Operating Systems, 2nd edn., : Prentice Hall.