States of a process: In this article, you will learn types of process states. A process passes through various states from it starts to till it get completed.There are following types of states of process:
States of a process diagram:
- New : – It is the state in which program is to be picked by operating system to be created in main memory.
- Ready: – Once the process is created now process goes into ready state, and waiting for CPU time to get executed. Process are maintained in a queue fashion by the CPU. There can be multiple processes in ready state.
- Running: – Process is chosen by the CPU for execution based on scheduling algorithm. There can be many processes in running state if there are multiple processors and not single processor.
- Block or wait: Sometimes a process may require input/output at that times it goes to wait state or block state. Once it get input/output it goes to ready state.
- Termination: When a process is finished it goes to termination state which is deleting of all PCB (process control block).
- Suspend ready: A process can be moved back to secondary memory from primary memory when CPU does not have sufficient resources or due to low priority then it is called suspend ready state.
- Suspend wait: It is same like suspend ready but when it reaches block or wait state and if the CPU does not have sufficient resource for the process then it is called suspend wait state.
Process State Transitions
- Running to ready state
- Waiting to ready
- Running to waiting
- Blocked to ready
- Running to terminated