Lab · Lectures 4 and 5
Process state game
An event happens to a process. Which state does it move to? Play until the seven-state diagram is reflex.
- 1
Start in Learn mode. Every arrow on the diagram is labelled, so you can read off the answer while you get used to it.
- 2
Click the next state (or press 1 to 7). Wrong answers show the correct arrow and a one-line reason.
- 3
Switch to the 60-second timed round. Labels disappear, your streak counts, and your best score is saved.
Try this first: the two suspend states. Most people forget that Suspend Wait goes to Suspend Ready when I/O completes, not straight to Ready.
How to play
An event happens to the highlighted process. Click the state it moves to. Correct answers build a streak, wrong ones show the right edge and why. Occasionally you will be asked where the state lives.
Keys 1 to 7 pick a state. 1 and 2 answer memory questions.
Best timed score: 0
| From | To | Event | Why |
|---|---|---|---|
| New | Ready | admit | Admission moves the process from secondary memory into the ready queue in main memory. |
| Ready | Running | dispatch | Dispatch gives the CPU to a ready process. Only Ready processes can be dispatched. |
| Running | Ready | interrupt / time slice | The process is still runnable. It only lost the CPU, so it goes back to Ready, not Waiting. |
| Running | Waiting (Block) | I/O or event wait | It cannot make progress until the I/O or event completes, so it blocks. The CPU goes to someone else. |
| Waiting (Block) | Ready | I/O complete | The event it was waiting for happened. It is runnable again, but it must queue for the CPU: Ready, not Running. |
| Running | Terminated | exit | Only a Running process can terminate. Its resources are released and the parent collects the exit status. |
| Ready | Suspend Ready | swap out | A runnable process swapped out to disk becomes Suspend Ready. It stays runnable, just not resident. |
| Suspend Ready | Ready | swap in | Swapping a Suspend Ready process back into main memory makes it Ready again. |
| Waiting (Block) | Suspend Wait | swap out | A blocked process that is swapped out stays blocked: Suspend Wait. Swapping does not finish its I/O. |
| Suspend Wait | Suspend Ready | event done | Its wait is over but it is still on disk, so it becomes Suspend Ready. It cannot jump straight to Ready. |
Note the missing edge: Suspend Wait never goes straight to Ready. Its event completes first (Suspend Wait to Suspend Ready), then it is swapped in (Suspend Ready to Ready).
Where each state lives
- Newsecondary memory
- Readymain memory
- Runningmain memory
- Waiting (Block)main memory
- Terminatedneither
- Suspend Readysecondary memory
- Suspend Waitsecondary memory