Process States & Transitions: 5-State vs 7-State Models
“The dynamic lifecycle of computation: New, Ready, Running, Waiting, Terminated and Swapping.”
1.The 5-State Process Lifecycle
§ 2.1.As a process executes, it changes state according to hardware conditions and scheduler choices. In the classic 5-State model, a process exists in exactly one of the following states at any instant:
1. New: The process is being created (memory structures initialized, PID allocated), but is not yet loaded into main memory or placed in the ready queue.
2. Ready: The process resides in main memory and is prepared to execute immediately as soon as the CPU scheduler allocates a core.
3. Running: Instructions are being executed directly on the CPU hardware core.
4. Waiting (Blocked): The process cannot execute until some external event occurs (such as I/O completion, page fault resolution, or child process exit).
5. Terminated: The process has finished execution; its resources are deallocated, awaiting parent cleanup.
2.The 7-State Model: Why Swapping & Suspended States Are Essential
§ 2.2.In real operating systems, the 5-state model has a fatal vulnerability: Physical RAM is finite. If the degree of multiprogramming is high and multiple processes block on slow disk I/O, main memory quickly becomes saturated with dormant, waiting processes.
Under the 5-state model, if every process in RAM is blocked waiting for I/O, the CPU would sit completely idle despite hundreds of jobs queued on disk. To solve this, modern operating systems introduce a third scheduler: the Medium-Term Scheduler (The Swapper).
The Medium-Term Scheduler frees up precious physical memory frames by swapping out inactive processes from RAM to secondary storage (Swap Space on SSD or HDD). This expands the lifecycle with two new suspended states:
6. Blocked-Suspend (Suspended-Blocked): The process resides in secondary storage (swap disk) AND is still waiting for an I/O event to occur.
7. Ready-Suspend (Suspended-Ready): The process resides in secondary storage, but the event it waited for has finished. It is ready to run as soon as space is allocated in main memory.
The Critical GATE Transition: What happens when an I/O event completes for a process in Blocked-Suspend? The process moves from Blocked-Suspend → Ready-Suspend, NOT directly to Ready! Because physical memory has not yet been allocated to it, it transitions to Ready-Suspend on disk first. Only when the medium-term scheduler swaps it back into RAM does it enter Ready.
3. Complete 7-State Process Lifecycle Architecture
Draw two horizontal dotted partition boxes: Upper box is Main Memory (RAM), lower box is Secondary Storage (Swap Space).
Professors first look for the clear spatial division between RAM (active execution) and Swap Disk (suspended states). Label both clearly.
Placing Ready-Suspend inside RAM. Ready-Suspend means PCB is in RAM but memory pages are on DISK.
4. Interactive Process State Transition Simulator
Click on the kernel trigger buttons to observe how process state transitions occur, which queues are affected, and what the OS kernel does behind the scenes.
5-State Process Machine Simulator
Process is in initial READY state. Waiting for CPU allocation.
5.Crucial State Transition Rules & Misconceptions
§ 2.5.When I/O completes, the CPU is already occupied executing another process. The waking process must join the Ready Queue and await its turn from the short-term CPU scheduler.
Waiting means the process CANNOT run even if the CPU were 100% idle. A preempted process is fully capable of running; it simply gave up the CPU to be fair to other ready processes.
Main memory might still be 100% full. The kernel moves it from the disk-blocked list to the disk-ready list until the Medium-Term Scheduler can swap out another victim or reclaim frames.
6. GATE Lens & Verified PYQs
Syllabus focus, recurring numerical patterns, common traps, and clearly labelled exam practice. Questions remain source-pending until an official paper and answer key are attached.
State transition validity and 5 vs 7-state transitions are consistently tested in GATE CS.
- •Listing possible state transitions and identifying illegal transitions.
- •Analyzing transitions in 7-state models (Ready-Suspend, Blocked-Suspend) with swapping.
- •Identifying which scheduler manages which transition (Long-term: New → Ready; Short-term: Ready → Running; Medium-term: Ready/Blocked ⇄ Suspended).
- •There is NO direct transition from Waiting → Running.
- •There is NO direct transition from New → Running.
- •Transition from Running → Ready is only possible in PREEMPTIVE scheduling systems.
- •Blocked-Suspend → Ready-Suspend occurs upon I/O event completion while the process is on disk.
Exam Practice / Source Verification Required
1 problemIn an operating system with preemptive scheduling, which of the following process state transitions is NEVER possible?
7. 1-Minute Panic Revision
“5 States: New → Ready ⇄ Running → Terminated. Running → Waiting → Ready. 7 States add Ready-Suspend & Blocked-Suspend on Disk.”
- •Running → Waiting: Process blocks voluntarily for I/O or event.
- •Waiting → Ready: Event finished. Enters Ready queue.
- •Running → Ready: Preemption (Time slice expired or higher priority process arrived).
- •Blocked-Suspend → Ready-Suspend: Event finishes while swapped to secondary storage.
- •Medium-Term Scheduler: Controls degree of multiprogramming via swapping (RAM ⇄ Disk).
- •Blocked/Waiting processes NEVER jump directly to the CPU core (Blocked → Running is impossible).
- •Non-preemptive OS has NO Running → Ready transition (processes run until voluntary block or exit).
- •Blocked-Suspend does NOT become Ready in RAM when I/O finishes; it becomes Ready-Suspend on Disk!
Primary Academic References & Exam Sources
Every concept in Notes From a B.Tech Brain is synthesized from authoritative academic texts, seminal peer-reviewed research, verified exam archives, and renowned university lectures.
Official Chapter 3 lecture slides covering process states, transitions, and ready queue mechanics.
Clear exposition of process state machine: Running, Ready, and Blocked with state transition diagram.
IIT Kharagpur lecture on process lifecycle, state queues, and medium-term swapper scheduling.
If the textbook derivation did not click immediately, consult these targeted video lessons:
Direct lecture explaining New, Ready, Running, Waiting, Terminated, and how the medium-term scheduler swaps blocked processes.
Whiteboard lecture breaking down exact transition triggers (admit, dispatch, interrupt, I/O wait, I/O completion).
Curated lectures on Process Lifecycle, PCB Memory Layout, Fork() System Calls & Multi-threading Models:
Rapid intuitive mastery of process state transitions and state diagram numericals.
Clear breakdown of blocking I/O behavior, thread context switches, and kernel space mapping.
Visual tree diagram derivations of fork() return values and process hierarchies.
Exam trick cases on how many times printf() executes in tricky fork() loops.