Process Life Cycle & States
A process does not run from start to finish in one go. It moves between five states. Play the animation, then click any state to study it in detail.
| State | Description |
|---|---|
| New (Start) | The process is actively being created by the OS. |
| Ready | The process is prepared to run and is waiting for CPU allocation. |
| Running | The CPU is actively executing the process instructions. |
| Waiting (Blocked) | The process is paused until a resource becomes available (e.g., waiting for input or file access). |
| Terminated (Exit) | Execution is completed or stopped, and the process is removed from memory. |
Real-world analogy: The doctor's clinic
Event responsible: User launches the program (fork/exec system call).
Process P1 is created — the OS builds its PCB.
| Transition | Triggering event | Who causes it |
|---|---|---|
| New → Ready | Admitted — memory allocated and PCB built | Long-term scheduler |
| Ready → Running | Dispatch — CPU allocated to the process | Short-term scheduler / dispatcher |
| Running → Waiting | I/O request or wait for a resource / event | The process itself (system call) |
| Waiting → Ready | I/O complete or resource available | Hardware interrupt handled by the OS |
| Running → Ready | Time quantum expired or higher-priority arrival | Timer interrupt (preemption by OS) |
| Running → Terminated | exit() called, or killed / fatal error | The process itself or the OS |
Running state
Definition: The process's instructions are actually being executed by the CPU.
What happens: Only one process per CPU core can be in this state at a time.
Example: The media player is decoding and playing your song right now.
Typical OS action: Runs it until it finishes, blocks for I/O, or its time quantum expires.
Transition condition: Running → Waiting (I/O request), Running → Ready (time quantum expired / preemption), Running → Terminated (finished).
- New → Ready — admitted by the long-term scheduler.
- Ready → Running — dispatched by the short-term scheduler.
- Running → Waiting — the process requests I/O or waits for an event.
- Waiting → Ready — the I/O or event has completed.
- Running → Ready — preempted (time quantum over or a higher-priority process arrived).
- Running → Terminated — execution completed or the process was killed.
1. A running process requests data from a hard disk. Which transition occurs?
2. How many processes can be in the Running state on a single-core CPU?
3. Which transition is IMPOSSIBLE?
Process P executes 4 ms of CPU work, then reads a file (6 ms), then executes 3 ms more and finishes. With a Round Robin quantum of 3 ms, list the sequence of states P passes through.