Course Content
Bonus Section (for Interviews and GATE/Placement prep)
0/2
Operating Systems (OS)
Preemptive vs Non-Preemptive Scheduling — CPU Scheduling

One of the most fundamental decisions in operating system design is whether to use preemptive or non-preemptive scheduling for managing CPU allocation. Both strategies define how the CPU switches between processes, and they affect performance, fairness, and responsiveness.

 

This section explains each type clearly, compares them side by side, and discusses real-world implications.


What is Preemptive Scheduling?

Preemptive scheduling allows the operating system to interrupt a currently running process in order to assign the CPU to another process—typically one with higher priority or shorter burst time.

 

This method is dynamic and responsive, enabling better multitasking, especially in systems with real-time or interactive requirements.

 

Key Points:

  • The CPU can be taken away from a process at any time.
  • Context switching occurs frequently.
  • Prioritizes responsiveness and fairness.

 

Examples:

  • Round Robin
  • Shortest Remaining Time First (SRTF)
  • Preemptive Priority Scheduling

What is Non-Preemptive Scheduling?

In non-preemptive scheduling, once a process starts executing on the CPU, it continues until it finishes or voluntarily releases the CPU (e.g., due to I/O wait).

 

This approach is simpler and avoids issues like race conditions and deadlocks but may lead to longer waiting times for other processes.

 

Key Points:

  • The CPU is not taken away forcefully.
  • No context switch occurs during a process’s burst time.
  • Ideal for batch systems where predictability is more important than interactivity.

 

Examples:

  • First-Come, First-Served (FCFS)
  • Shortest Job First (Non-Preemptive)
  • Non-Preemptive Priority Scheduling

Side-by-Side Comparison
Feature Preemptive Scheduling Non-Preemptive Scheduling
CPU Interruption Allowed Not allowed
Context Switching Frequent Rare
System Responsiveness High Lower
Implementation Complexity Higher Simpler
Suitable For Real-time, time-sharing OS Batch systems, simple workloads
Starvation Risk Higher (for low-priority jobs) Lower
Overhead More (due to switching) Less

Practical Implications

  • Interactive Systems (like Windows, Linux desktops): Prefer preemptive scheduling to ensure responsive UI and fair multitasking.

 

  • Embedded or Batch Processing Systems: Often use non-preemptive scheduling for simplicity and predictability.

 

  • Real-Time Systems: Typically use preemptive strategies with defined priorities to meet time constraints.

Summary

The main difference lies in whether the CPU can forcibly switch processes. Preemptive scheduling provides better performance for multitasking and interactivity but comes at the cost of added complexity and potential overhead. Non-preemptive scheduling is easier to manage and safer for specific workloads but can result in inefficient CPU usage or delays for shorter jobs.

0% Complete
WhatsApp Icon

Hi Instagram Fam!
Get a FREE Cheat Sheet on System Design.

Hi LinkedIn Fam!
Get a FREE Cheat Sheet on System Design

Loved Our YouTube Videos? Get a FREE Cheat Sheet on System Design.