Operating System - process state transition

In an Operating System (OS), process state transition refers to the change in a process's state during its lifecycle. A process is an instance of a program in execution, and it goes through various states based on its execution and resource needs.

Common Process States

  1. New: The process is being created.

  2. Ready: The process is waiting to be assigned to a CPU.

  3. Running: The process is currently being executed on the CPU.

  4. Waiting (Blocked): The process is waiting for some event (like I/O completion).

  5. Terminated (Exit): The process has finished execution.

State Transitions

Below are typical transitions between these states:

Transition Explanation
New → Ready The process has been created and is ready to run.
Ready → Running The scheduler selects the process for execution.
Running → Waiting The process requests an I/O operation or waits for a resource.
Running → Ready The process is preempted by the scheduler (e.g., time slice expired).
Waiting → Ready The I/O or event the process was waiting for has occurred.
Running → Terminated The process finishes execution or is killed.

Draw the process state transition diagram and explain the transitions of  state.i) running to ready ii) waiting to ready iii) running to waiting iv)  blocked to ready v) running to terminated