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

CPU Scheduling Fundamentals

College Depth 99 in the knowledge graph ☐ I know this ☆ Set as goal
33topics build on this
363prerequisites beneath it
See this on the map →
Process States and State TransitionsContext Switching and CPU Dispatch→→CPU Scheduling AlgorithmsFirst-Come-First-Served (FCFS) Scheduling+5 more
scheduling dispatcher turnaround-time waiting-time cpu-burst

Core Idea

CPU scheduling is the task of deciding which ready process runs next on the CPU, with the goal of maximizing utilization and meeting fairness or latency objectives. The scheduler operates at multiple levels: long-term (admission), medium-term (swapping), and short-term (dispatch). Key metrics for evaluating schedulers include CPU utilization, throughput, turnaround time (total time from submission to completion), waiting time, and response time. Processes alternate between CPU bursts (active computation) and I/O bursts (waiting on devices), and this burst pattern heavily influences which scheduling algorithm performs best.

How It's Best Learned

Simulate scheduling decisions on paper with a Gantt chart using five or six example processes with different burst times. Calculate waiting and turnaround times for each algorithm.

Common Misconceptions

Explainer

From your study of process states and lifecycles, you know that a process cycles through states — new, ready, running, waiting, terminated — and that multiple processes can be in the ready state simultaneously. CPU scheduling is the policy that decides which of those ready processes gets the CPU next, and it is one of the most consequential decisions an operating system makes, because the CPU is typically the most contended resource in the system.

Think of scheduling like a doctor's office with one examination room. Patients (processes) arrive, wait in the lobby (ready queue), and eventually get seen. The key question is: in what order? First-Come-First-Served (FCFS) is simplest — patients are seen in arrival order — but a patient needing a quick blood pressure check waits behind a patient getting a full physical. Shortest-Job-First (SJF) is provably optimal for minimizing average waiting time — see the quick patients first — but it requires knowing how long each appointment will take, which is rarely known in advance. These tradeoffs between simplicity, optimality, and information requirements define the scheduling problem.

The distinction between preemptive and non-preemptive scheduling is fundamental. In non-preemptive scheduling, once a process gets the CPU, it runs until it voluntarily yields (by completing or blocking on I/O). In preemptive scheduling, the OS can interrupt a running process and move it back to the ready queue — for example, when a higher-priority process becomes ready or when a time quantum expires. Preemption is essential for interactive systems where responsiveness matters: without it, a single compute-bound process could monopolize the CPU while users wait for their keystrokes to be processed.

The metrics for evaluating schedulers reflect different stakeholders. CPU utilization (percentage of time the CPU is busy) matters for system throughput. Turnaround time (total time from process submission to completion) matters for batch workloads. Waiting time (time spent in the ready queue) and response time (time from submission to first output) matter for interactive users. No single algorithm optimizes all metrics simultaneously, which is why real operating systems use sophisticated multi-level feedback queues that adapt their behavior based on observed process characteristics — promoting I/O-bound processes for quick turnaround while ensuring CPU-bound processes still make progress.

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

Longest path: 100 steps · 363 total prerequisite topics

Prerequisites (2)

Leads To (7)