Overview

CPU Scheduling is the core subsystem responsible for multiplexing physical CPU cores across runnable processes and threads. By separating the Mechanism (context switching and state queues) from the Policy (selecting which thread runs next), the CPU scheduler balances system performance, responsiveness, resource utilization, and fairness across diverse workloads.


Module Structure & Notes

Note LinkDescriptionKey Concepts & Metrics
CPU Scheduling Fundamentals & MetricsExplores policy vs. mechanism, dispatcher triggers, scheduling metrics (, ), workload profiles (batch vs. interactive), CPU utilization math, and starvation.Turnaround Time, Response Time, Preemption, CPU Utilization, Starvation
Classic Scheduling AlgorithmsAnalyzes foundational scheduling policies: First-Come First-Served (FCFS), Shortest Job First (SJF), Shortest Remaining Time to Completion First (SRTCF), Round Robin (RR), and Priority Scheduling.FCFS, SJF, SRTCF, Round Robin, Quantum, Priority
Multilevel Feedback Queue & Real-World SchedulersDetails adaptive priority decay in MLFQ, I/O burst handling, and production schedulers (Linux Completely Fair Scheduler - CFS, macOS/Windows MLFQ).MLFQ, Priority Decay, I/O Bursts, Linux CFS, Windows Scheduler

Policy vs. Mechanism in CPU Scheduling

void yield() {
    thread_t old_thread = current_thread;
    
    current_thread = get_next_thread();       // <--- POLICY (Which thread runs next?)
    
    append_to_queue(ready_queue, old_thread);
    context_switch(old_thread, current_thread); // <--- MECHANISM (Assembly hardware switch)
    return;
}

Related Modules