A process doesn't simply run from start to finish — it moves through a fixed set of states as the operating system juggles it against every other process. The OS records the current state, plus everything needed to resume, in the process's PCB (Process Control Block). On a single CPU core, only one process is actually Running at any instant; the rest are waiting their turn or blocked on slow work.
The five states
1New — the process is being created and is not yet admitted to memory.
2Ready — loaded and able to run, sitting in the ready queue, waiting only for the CPU.
3Running — currently executing on the CPU. Only one process per core is here at a time.
4Waiting (Blocked) — paused for an event such as a disk read or user input; it can't use the CPU until that event completes.
5Terminated — finished or killed; its resources are being reclaimed.
The transitions
1Admit: New -> Ready, once the long-term scheduler lets it into memory.
2Dispatch: Ready -> Running, when the short-term scheduler, via the dispatcher, hands it the CPU.
3Preempt / timeout: Running -> Ready, when a timer interrupt ends its time slice — it rejoins the queue, it is *not* blocked.
4Block: Running -> Waiting, when it requests I/O or waits for an event.
5Wake: Waiting -> Ready, when the awaited I/O or event completes — note it returns to *Ready*, not straight to Running.
6Exit: Running -> Terminated, when it finishes or is killed.
Waiting and Ready are not the same
A Ready process wants only the CPU — give it a core and it runs. A Waiting process can't use the CPU even if one is free, because it's blocked on an external event. Confusing the two is the classic exam mistake.
How a switch actually happens
When a process leaves Running, the dispatcher saves its registers and program counter into its PCB, then loads the next process's saved state from *its* PCB — that's a context switch, and it's pure overhead.
OperationTimeSpace
Context switch · dispatch latency — overhead, no useful workO(save + restore registers)O(1) per PCB
Check yourself
An I/O operation a process was blocked on finally completes. Which state does the process move to?