How Your Operating System Decides What Runs Next

Опубликовано: 03 Октябрь 2026
на канале: Systems, Measured
13
1

How an operating system decides which thread runs on each CPU core, and for how long. The video starts with processes, threads and the timer interrupt, works through the classic policies (FIFO, shortest job first, round robin, MLFQ, lottery and stride scheduling), then shows what Linux, Windows and macOS do today: CFS and EEVDF, priority boosts, performance and efficiency cores, and real-time classes. Made for people with an IT or CS background; no operating-systems knowledge needed.

Every measurement in the video is real, taken on 1 Oct 2026: an Apple M5 laptop (macOS 26), a Ryzen 9 7945HX laptop (Windows 11), and a Linux system (Linux 6.6, running under WSL2 on that same Ryzen laptop).

CHAPTERS
0:00 Ten cores, seven thousand threads
1:02 Processes, threads and states
2:05 Taking the CPU back
3:49 What makes a schedule good
4:15 FIFO, shortest job first, round robin
5:38 Learning from behaviour: MLFQ
7:09 Fair shares: lottery, stride and CFS
9:18 EEVDF: fairness with deadlines
10:34 Many cores, different cores
12:08 Real-time scheduling
12:56 Try it yourself

SOURCES (primary sources; the full list, claim by claim, is in the pinned comment)

Textbook: Arpaci-Dusseau & Arpaci-Dusseau, Operating Systems: Three Easy Pieces (OSTEP) — https://pages.cs.wisc.edu/~remzi/OSTEP/
Ch. 4 The Process — https://pages.cs.wisc.edu/~remzi/OSTEP/cpu...
Ch. 6 Limited Direct Execution — https://pages.cs.wisc.edu/~remzi/OSTEP/cpu...
Ch. 7 Scheduling: Introduction — https://pages.cs.wisc.edu/~remzi/OSTEP/cpu...
Ch. 8 Multi-Level Feedback Queue — https://pages.cs.wisc.edu/~remzi/OSTEP/cpu...
Ch. 9 Proportional Share — https://pages.cs.wisc.edu/~remzi/OSTEP/cpu...
Ch. 10 Multiprocessor Scheduling — https://pages.cs.wisc.edu/~remzi/OSTEP/cpu...
Ch. 26 Concurrency: An Introduction — https://pages.cs.wisc.edu/~remzi/OSTEP/thr...

Processes, threads and states (OSTEP 4, 26)
sched(7) — https://man7.org/linux/man-pages/man7/sche...
Microsoft, CPU Analysis — https://learn.microsoft.com/en-us/windows-...

Taking the CPU back (OSTEP 4, 6, 7)
McVoy & Staelin, lmbench (1996) — https://www.usenix.org/legacy/publications...
Linux Kconfig.hz — https://github.com/torvalds/linux/blob/mas...
Linux NO_HZ docs — https://docs.kernel.org/timers/no_hz.html

What makes a schedule good; FIFO, shortest job first, round robin (OSTEP 7)

Learning from behaviour: MLFQ (OSTEP 7, 8)
Corbató et al., 1962 — https://cseweb.ucsd.edu/classes/wi19/cse22...
Microsoft, Scheduling Priorities — https://learn.microsoft.com/en-us/windows/...
Microsoft, Priority Boosts — https://learn.microsoft.com/en-us/windows/...

Fair shares: lottery, stride and CFS (OSTEP 9)
Waldspurger & Weihl, Lottery Scheduling (1994) — https://www.usenix.org/legacy/publications...
Waldspurger & Weihl, Stride Scheduling (1995) — https://www.waldspurger.org/carl/papers/st...
Linux CFS docs — https://docs.kernel.org/scheduler/sched-de...

EEVDF: fairness with deadlines
Stoica & Abdel-Wahab, EEVDF (1995) — https://citeseerx.ist.psu.edu/document?rep...
Linux EEVDF docs — https://docs.kernel.org/scheduler/sched-ee...
LWN, An EEVDF CPU scheduler for Linux — https://lwn.net/Articles/925371/
LWN, Completing the EEVDF scheduler — https://lwn.net/Articles/969062/

Many cores, different cores (OSTEP 10)
Linux Energy Aware Scheduling — https://docs.kernel.org/scheduler/sched-en...
Apple, Tuning for Apple silicon — https://developer.apple.com/documentation/...
Microsoft, Quality of Service — https://learn.microsoft.com/en-us/windows/...
Intel, Hybrid architecture white paper — https://cdrdv2-public.intel.com/685861/211...

Real-time scheduling
sched(7) — https://man7.org/linux/man-pages/man7/sche...
Linux Real-Time group scheduling — https://docs.kernel.org/scheduler/sched-rt...
Microsoft, Priority Boosts — https://learn.microsoft.com/en-us/windows/...

TRY IT YOURSELF (Linux; on macOS, nice works and ps -M lists threads)
ps -eLf — list every thread
top — NI and PR columns: nice value and priority
nice -n 5 ./job — start a program at lower priority
chrt -p $PID — show a process's scheduling policy
cat /proc/$PID/sched — what the scheduler tracks for a process, including virtual runtime
On desktops, nice mostly compares tasks in the same session, so start both programs from one terminal.

Narration is synthesized (Gemini TTS, a designed voice). Music is original and synthesized in code.