operating-systems

Definition

Process State Model

The process state model describes the lifecycle of a process through discrete states, helping the OS manage CPU allocation and resource distribution.

5-State Model

The five-state model accounts for creation, execution, and termination:

  1. New: Process being created. OS has built data structures but not yet admitted it to the ready queue.
  2. Ready: Process has all required resources, waiting for CPU time.
  3. Running: Process currently executing on the CPU.
  4. Blocked (Waiting): Process cannot continue until an event occurs (I/O completion, synchronisation).
  5. Exit (Terminated): Process finished or aborted. OS is recording resource usage before deleting data structures.

Transitions

Dispatch

Scheduler selects a process from the ready queue to run next.

Timeout

Process has used its time slice (quantum) and returns to ready queue.

Event Wait

Process initiates an operation (I/O request) forcing it to wait.

Event Occurs

External event completes, moving process back to ready state.

Release

Process completes final instruction or is terminated by parent/OS.

7-State Model

The seven-state model adds two suspended states for processes swapped out of RAM to secondary storage.

Suspended States

Ready/Suspend

Process in secondary memory, ready to run once loaded into main memory.

Blocked/Suspend

Process in secondary memory waiting for an event. Moves to Ready/Suspend when event occurs.

Purpose

Freeing RAM

Moving a process to disk frees space for active processes.

Swapping

OS swaps out blocked processes likely to remain inactive.

System Stability

Suspending processes prevents crashes due to memory exhaustion.

Suspended processes require a Swap In operation to return to Ready state before getting CPU.