Process States
Watch a real process travel the five-state lifecycle, and see which transitions are impossible.
Skip to the animationA process is a program in execution, and over its life it moves between five states — new, ready, running, waiting and terminated — driven by the scheduler, by I/O, and by the process's own requests.
Program vs process
A program is passive: bytes sitting in a file on disk. A process is active: that program plus everything needed to run it — its current instruction, its registers, its stack, its heap, its open files. Run the same program twice and you get two processes that share nothing.
The OS tracks each one in a Process Control Block (PCB): process ID, state, saved registers and program counter, memory map, open file table, accounting and priority information. The PCB *is* the process as far as the kernel is concerned — a context switch is precisely the act of saving the CPU into one PCB and loading it from another.
The five states
- New
- Being created. The PCB is being set up and the program loaded; it is not yet a candidate for the CPU.
- Ready
- Able to run right now, waiting only for a CPU to be free. Many processes are in this state at once — collectively, the ready queue.
- Running
- Actually executing on a CPU. On a single core, exactly one process is in this state at any instant. That scarcity is the entire reason scheduling exists.
- Waiting (blocked)
- Cannot proceed until some event happens — an I/O completion, a signal, a lock being released. Giving it the CPU would be pointless, so it does not get one.
- Terminated
- Finished. The OS reclaims its memory and files; the PCB lingers only long enough for the parent to collect the exit status.
The six transitions
- 1New → Ready (*admitted*): setup is complete and the process joins the ready queue.
- 2Ready → Running (*dispatch*): the scheduler picks it and the dispatcher loads its registers.
- 3Running → Ready (*interrupt / preemption*): its time slice expired, or something more urgent arrived. It did nothing wrong and is still perfectly runnable.
- 4Running → Waiting (*I/O or event wait*): it asked for something slow, so it surrenders the CPU rather than waste it.
- 5Waiting → Ready (*event completed*): the data arrived. It is runnable again — but it does not get the CPU back automatically.
- 6Running → Terminated (*exit*): it finished, or was killed.
The transitions that do not exist
Exam questions live here, and both gaps follow from the definitions rather than from any arbitrary rule.
- Waiting → Running is impossible. When your I/O finishes, some other process owns the CPU. You have to queue like everyone else, so the path is Waiting → Ready → Running.
- Ready → Waiting is impossible. Blocking means executing a request and discovering you must wait — and you cannot execute anything unless you are Running.
Running is the only state with more than one way out, and Ready is the only door into Running.
Watch it work
Check yourself
question 1 / 4
One question at a time. Pick an answer to see why it is right or wrong, then move on — there is no score to keep and nothing is saved.