chapter
    CPU Scheduling Notes for GATE CS

    CPU Scheduling notes for GATE CS: 42 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.

    cpu scheduling notes

    Chapter Roadmap: CPU Scheduling

    The CPU Scheduling Journey
    Foundations & Metrics: Arrival, Burst, Completion, Turnaround, Waiting, Response.
    SJF & SRTF: Optimal algorithms for minimizing average waiting time.
    Scheduling Properties: Preemption overhead, starvation, convoy effect.
    Round Robin (RR): Time-slicing, quantum selection, context switches.
    Priority & Multiprocessor: Diverse workloads and multi-CPU distribution.

    Topic Hero: The Core Philosophy of SJF and SRTF

    The primary objective of any scheduling algorithm is to optimize system metrics. For batch systems, the most critical metric is average waiting time.
    The Mathematical Truth: To minimize the sum of waiting times, you must execute the shortest jobs first. If you execute a long job first, all subsequent short jobs are forced to wait for the entire duration of that long job.
    • Shortest Job First (SJF): Non-preemptive. Once a process gets the CPU, it runs to completion.
    • Shortest Remaining Time First (SRTF): Preemptive. If a newly arrived process has a burst time strictly less than the remaining time of the currently running process, the CPU is snatched away.
    Note: Both algorithms are mathematically proven to give the minimum average waiting time for a given set of processes.

    Executing Non-Preemptive SJF

    Core Rule: No Preemption

    Once a process starts, it runs to completion.

    1. Identify current time .
    2. Filter processes where .
    3. Select process with minimum .
    4. Tie-breaker: If same , pick earliest (FCFS).
    5. Allocate CPU. New time . Record .
    6. Repeat until all completed.
    CPU Idle? If no processes have arrived (), CPU remains idle until the earliest remaining .

    39 more cards in this chapter

    Free preview ends here

    Login to view the complete notes

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    CPU Scheduling Notes for GATE CS

    CPU Scheduling notes for GATE CS: 42 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.

    Chapter Roadmap: CPU Scheduling

    The CPU Scheduling Journey
    Foundations & Metrics: Arrival, Burst, Completion, Turnaround, Waiting, Response.
    SJF & SRTF: Optimal algorithms for minimizing average waiting time.
    Scheduling Properties: Preemption overhead, starvation, convoy effect.
    Round Robin (RR): Time-slicing, quantum selection, context switches.
    Priority & Multiprocessor: Diverse workloads and multi-CPU distribution.

    Topic Hero: The Core Philosophy of SJF and SRTF

    The primary objective of any scheduling algorithm is to optimize system metrics. For batch systems, the most critical metric is average waiting time.
    The Mathematical Truth: To minimize the sum of waiting times, you must execute the shortest jobs first. If you execute a long job first, all subsequent short jobs are forced to wait for the entire duration of that long job.
    • Shortest Job First (SJF): Non-preemptive. Once a process gets the CPU, it runs to completion.
    • Shortest Remaining Time First (SRTF): Preemptive. If a newly arrived process has a burst time strictly less than the remaining time of the currently running process, the CPU is snatched away.
    Note: Both algorithms are mathematically proven to give the minimum average waiting time for a given set of processes.

    Executing Non-Preemptive SJF

    Core Rule: No Preemption

    Once a process starts, it runs to completion.

    1. Identify current time .
    2. Filter processes where .
    3. Select process with minimum .
    4. Tie-breaker: If same , pick earliest (FCFS).
    5. Allocate CPU. New time . Record .
    6. Repeat until all completed.
    CPU Idle? If no processes have arrived (), CPU remains idle until the earliest remaining .

    Executing Preemptive SRTF

    Core Rule: Preemption on Strictly Smaller RBT
    1. Maintain Remaining Burst Time (RBT) table.
    2. At time , filter processes with and .
    3. Select process with minimum RBT.
    4. Tie-breaker: If RBTs equal, earliest continues (No preemption).
    5. Run for 1 unit (or until next arrival). Decrease RBT by 1.
    6. If , record . Check new arrivals.
    Crucial Condition: Preempt ONLY if . If equal, do NOT preempt.

    More notes in this unit