LightMySky

Scheduling: Deciding Which Process Runs Next

A scheduler chooses from the ready processes, and every rule it could use favours something: throughput, response time, or fairness. Round robin, shortest job first and priority with ageing each make that trade differently.

No account needed. Progress saves in this browser.

What a learner can do afterwards

  • Work out average waiting time for a job set under two different policies
  • Show how a long-running job starves under strict priority, and how ageing fixes it
  • Say which policy suits an interactive machine and which suits a batch one

1 · Read

Four jobs arrive together needing 8, 6, 4, and 2 minutes. First-come order 8, 6, 4, 2 waits 0, 8, 14, 18, averaging 10. Shortest-first order 2, 4, 6, 8 waits 0, 2, 6, 12, averaging 5. Order alone halves the wait.

Round robin instead deals short turns to each job in turn. Nobody waits long for a first slice, so typing stays snappy, though long jobs finish later than under shortest-first. Shortest-first minimizes average wait but needs known bursts.

Try it together

Under strict priority a long low job can wait forever while short high jobs keep arriving. Ageing fixes this by raising a waiter's rank the longer it queues, so every job finally reaches the front.

Good to know

Match the rule to the room. Favor round robin for interactive machines where response matters, and shortest-first for batch rooms where average wait matters.

Shortest-first shrinks average wait, round robin shrinks response, and ageing ends starvation.

2 · Watch

Take it off screen

Print a worksheetA4 with an answer key page for grown-ups. No screen, no internet.

Where it sits

Then practise

8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.

Spotted a problem on this page? Tell us
Scheduling: Deciding Which Process Runs Next · Computing, ages 19 to 21 · LightMySky