How To

What are states of a process and process state diagram

States of a Process

Theoretically and practically both combined there are more than 5 states of the process and in our explanation, we are going to learn a process state diagram with the help of 7 states of a process.

  • (SM) New: When the process is in secondary memory.
  • (MM) Ready: Process is now in main memory (RAM).
  • (MM) Run: In this state, the process is now being entertained by the CPU.
  • (MM) Block OR Wait: In main memory and is entertained by any I/O device and after completion, it goes to Ready State again.
  • Termination OR Completion: Everything, like memory and PCB allocated to a process, is deleted.
  • (SM) Suspend Ready: Suspend which processes are ready.
  • (SM) Suspend Wait OR Suspend Block: Suspend those which are already blocked.

SM = Secondary Memory (hard disk, SSD, flash drive et cetera)

MM = Main Memory (RAM)

Several operations performed on a process are:

1. Create

2. Schedule

3. Execute

4. Kill/Delete

Process State Diagram

states of a process and process state diagram

From the above diagram it should be clear that several states of a process are involved in its lifetime, firstly the process is created and then it goes to ready state where it goes under dispatching process and this is done by a short-term scheduler, then after it is now in running state and if there is some kind of I/O request then the process goes under wait/block state and from there it serves that particular I/O after the completion of I/O it again goes to ready state.

There are two more states to process state diagram, Suspend Ready and Suspend Wait when the process is in wait/block state it can be suspended and thrown to suspend wait state and can resume from them, other one is suspend ready state the process comes to this state when it has completed the I/O but still is in suspend state and is ready to perform further execution.

Summary: We have explained process states and other related terms in the post, there are three more terms introduced – Long-term scheduler, Short-term scheduler, Mid-term scheduler these are going to be discussed in future posts.

Comment here