A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Scheduling Fairness and Starvation Prevention

College Depth 102 in the knowledge graph ☐ I know this ☆ Set as goal
24topics build on this
366prerequisites beneath it
See this on the map →
CPU Scheduling FundamentalsFirst-Come-First-Served (FCFS) Scheduling→→Real-Time Scheduling AlgorithmsThread Scheduling and Coordination
scheduling fairness concurrency

Core Idea

Fair scheduling ensures all processes receive a reasonable share of CPU time and prevents indefinite delay (starvation). Starvation can occur when high-priority processes continuously arrive or when low-priority lock holders block high-priority processes. Modern systems use aging, priority inheritance, and proportional-share scheduling to mitigate these problems.

Explainer

From your study of CPU scheduling basics, you know that the scheduler decides which ready process gets the CPU next, using algorithms like round-robin, shortest-job-first, or priority scheduling. Each algorithm optimizes for something — throughput, response time, or urgency. But optimizing for one metric can create a dangerous side effect: some processes may wait indefinitely. This indefinite postponement is called starvation, and preventing it is one of the central challenges in scheduler design.

Starvation most commonly occurs in priority scheduling. Imagine a system where high-priority processes keep arriving faster than they can complete. Every time the scheduler checks the ready queue, it finds a high-priority process waiting, so the low-priority process at the back never runs. The low-priority process is technically ready — it has everything it needs — but it starves because the scheduler always picks someone else. This is analogous to standing in a line where anyone with a VIP pass can cut in front of you: if VIPs arrive continuously, you wait forever.

The classic solution is aging — gradually increasing a process's priority the longer it waits. A process that has been in the ready queue for a long time eventually reaches a priority high enough to compete with newcomers. Aging converts a strict priority system into one that balances urgency with fairness. A related problem is priority inversion, where a high-priority process is blocked waiting for a lock held by a low-priority process, and a medium-priority process preempts the lock holder, indirectly blocking the high-priority one. Priority inheritance fixes this by temporarily boosting the lock holder's priority to match the highest-priority waiter, ensuring the lock is released promptly.

Beyond these fixes, some schedulers take a fundamentally different approach to fairness. Proportional-share (or fair-share) schedulers allocate CPU time as shares rather than strict priorities — a process with twice the shares gets roughly twice the CPU time, but no process gets zero. Linux's Completely Fair Scheduler (CFS) implements this idea using a virtual runtime metric: it always picks the process with the least accumulated virtual runtime, ensuring that over any reasonable time window, every process receives its proportional allocation. The key insight is that fairness and efficiency are not opposites — a well-designed scheduler achieves both by bounding how long any process can be neglected.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Kernel Architecture and OS Structure → System Calls and User/Kernel Mode → Processes and the Process Control Block → Process Creation: fork() and exec() → Process Termination and Resource Cleanup → Process States and State Transitions → Process Model Formalization → Context Switching and CPU Dispatch → CPU Scheduling Fundamentals → Round-Robin (RR) Scheduling → First-Come-First-Served (FCFS) Scheduling → Scheduling Fairness and Starvation Prevention

Longest path: 103 steps · 366 total prerequisite topics

Prerequisites (2)

Leads To (2)