Explain like I'm five · Systems

What is CPU Scheduling?

CPU scheduling, told as a story about the garage chief deciding which car gets the one lift next.

This garage IS a computer systemOne lift (the CPU), but cars (jobs) keep arriving

This garage IS a computer system.One lift (the CPU), but cars (jobs) keep arriving.

full engine teardown… 3 hours inI just need air in my tires, still waitingA bad order means even a quick job waits forever behind a long one

Pick the car order carelessly, and a slow car that came first blocks all the others.Even a quick job waits forever behind a long one.

JOB QUEUE1. #118 (tires)2. #119 (oil)3. #120 (engine)CPU scheduling = the chief writing a rule on the board to set the car orderWhich rule is used decides who gets the lift first

CPU scheduling = the chief writing a rule on the board to set the car order.Which rule is used decides who gets the lift first.

FCFSfirst come, first served — the simplest rule
SJFshortest job finishes first
Round Robineveryone gets a small turn, round and round
Priorityan urgent car cuts in line
RULES COMPAREDFCFS: in arrival orderSJF: shortest job firstRound Robin: small turns, round-robinPriority: urgent car firstthe chief picks one and writes it on the boardround-robin shares the lift in short turns, but swapping cars costs a little time each turn

FCFS is simple but a long car blocks the rest; SJF shortens waits but pushes long cars back.Round-robin is fair, but switching cars costs a little time each turn.

shortest-job-first keeps the average wait lowbut the long job keeps getting skipped (starvation)no single rule is perfect — fairness and speed often pull against each other

No single rule is perfect.Fairness and speed often pull against each other.

In one breath

CPU scheduling = the rule that decides which car (job) gets the one lift (CPU) next when several arrive at once.

The OS decides the order in which processes get the CPU. FCFS, SJF (Shortest Job First), Round Robin (time-sliced), and Priority Scheduling are the classic algorithms. FCFS is simple but suffers the convoy effect; SJF minimizes average wait but can starve long jobs; Round Robin shares turns fairly via a time quantum but pays a context-switch cost each turn.

When grown-ups say it

FCFS
Load cars in the order they arrived. Simple, but a long car blocks everyone behind it.
SJF
Finish the shortest job first. Lowers average wait, but can starve long jobs.
Round Robin
Give everyone a small, rotating turn. Fair, but each switch costs a little time (context switch).
Starvation
A car that keeps getting bumped down the board. Starvation is covered alongside deadlock. → the garage frozen waiting on each other's keys
Synchronization
The rule for handing out the lift key. Scheduling is "who goes first" — this is "don't touch at once." → there's only one lift key
Process/Thread
One car vs. several hands working the same car. The actual scheduling unit is often the thread. → one car, many hands
Time Complexity
The ruler for how fast work grows as cars pile up. Re-sorting the board each time is measured with this ruler too. → how much slower as cars pile up
Orchestration
A similar 'ordering' idea in the SRE field. A similar problem shows up one layer up, at the service/container level. → orchestration in the SRE field
Next story
There's Only One Lift Key →
Want another term as a picture book? Request →