---
title: "Scheduling: Deciding Which Process Runs Next"
description: "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 balance th"
canonical: https://lightmysky.com/learn/computing/scheduling-deciding-which-process-runs-next-mt_QZYzfVIcP6
source: https://lightmysky.com/learn/computing/scheduling-deciding-which-process-runs-next-mt_QZYzfVIcP6.md
retrieved: 2026-11-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# 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 balance those goals differently.

Subject: Computing · Area: Computer Systems · Ages 19 to 21
Page: https://lightmysky.com/learn/computing/scheduling-deciding-which-process-runs-next-mt_QZYzfVIcP6

## Ready when they can

- Work out average waiting time for a job set under two different policies
- Show how a low-priority job can starve under strict priority, and explain an ageing scheme that prevents it
- Say which policy suits an interactive machine and which suits a batch one

## Lesson: Picking who runs next, and why

Waiting time is time ready but not running. Here, all jobs arrive at time 0 on one CPU, each has one burst, and switch cost is ignored. For bursts 8, 6, 4, 2, first-come order gives waits of 0, 8, 14, 18: mean 10. Shortest-job-first (SJF) orders 2, 4, 6, 8 and gives waits of 0, 2, 6, 12: mean 5. Add waits and divide by four. Subtract the means to compare policies.

Round robin gives each ready job a time slice, then moves an unfinished job to the queue's back. A job that finishes early gives up its turn. Response time is time until its first run. For jobs arriving at time 0, total waiting time is completion time minus burst length. With initial queue A, B, C, bursts 5, 3, 1 and slice 2, the timeline below shows how to trace the turns.

*(drawing: A, B, C start ready at time 0. C finishes at 5, B at 8 and A at 9. Their waits are 4, 5 and 4.)*

For jobs all ready together on one CPU, with known burst lengths and no switch cost, non-preemptive shortest-job-first minimizes average waiting time. It runs each selected job to completion. Real schedulers often estimate the next burst; poor estimates can change the result.

An interactive system often wants ready jobs to receive regular short turns. Round robin can serve that goal when the queue and slice are not too large. A batch system may instead prioritize average waiting time. Shortest-job-first fits the known-burst model, but workload and fairness goals still matter.

Strict priority can leave a low-priority job ready forever if higher-priority work keeps arriving. This is starvation; burst length alone is not the cause. One ageing scheme promotes waiting jobs up bounded priority levels. With first-in, first-out (FIFO) order at the highest level and finite bursts, a job reaching that level eventually gets a turn.

Very short slices can cause many context switches. When switches cost time, that leaves less CPU time for useful work. Longer slices reduce this overhead but can delay other jobs' next turns. A slice choice balances switching cost against responsiveness.

**Recap.** Compare waiting and response separately. SJF's optimum needs stated assumptions; round robin shares turns, and suitable ageing rules prevent starvation.

*Original lesson, questions and flashcards about CPU scheduling.*

## Practice

8 questions on this page, each with its working shown.

## Needs first

- [Processes, Context Switches and What They Cost](https://lightmysky.com/learn/computing/processes-context-switches-and-what-they-cost-mt_oiOwHKUoXG)

## Optional connections

- [Queues: First In, First Out](https://lightmysky.com/learn/computing/queues-first-in-first-out-mt_4U1bT0JW4g)

## Opens up

- [Virtual Memory and Address Translation](https://lightmysky.com/learn/computing/virtual-memory-and-address-translation-mt_B-PiAyderj)
- [Observability and Tail Latency Across Services](https://lightmysky.com/learn/computing/observability-and-tail-latency-across-services-mt_NT5tmumdfA)
