# Preemptive vs Non-Preemptive Scheduling

> Preemptive scheduling can forcibly take the CPU from a running process before it finishes, for example when a time slice expires or a more urgent process arrives, as in Round Robin and SRTF. Non-preemptive scheduling lets a process keep the CPU until it finishes or voluntarily blocks, as in FCFS and non-preemptive SJF.

Canonical: https://devsunite.com/resources/core-subjects/operating-systems/preemptive-vs-non-preemptive-scheduling
Last updated: 2026-11-22

Subject: Operating Systems · Category: Process Scheduling · 3 min read

Every CPU scheduling algorithm falls into one of two categories based on a single question: once a process starts running, can the scheduler forcibly interrupt it before it finishes or voluntarily yields?

## Non-preemptive scheduling

Once a process is given the CPU, it keeps it until it either finishes entirely or voluntarily blocks (for example, to wait on I/O). The scheduler only makes a new decision at those two moments, a process ending or a process giving up the CPU on its own. FCFS and non-preemptive SJF are the classic examples.

## Preemptive scheduling

The scheduler can forcibly take the CPU away from a currently-running process, even if that process hasn't finished and hasn't voluntarily given anything up, usually because a more urgent process needs to run, or because a fixed time slice has expired. Round Robin, Priority Scheduling (in its preemptive form), and SRTF are the classic examples.

## The real tradeoff

Non-preemptive scheduling is simpler to implement and has no context-switching overhead beyond what naturally happens when a process finishes or blocks. But it's a poor fit for interactive systems: if a long process is running non-preemptively, every other process, no matter how urgent, has to wait for it to finish or block on its own, which could take a very long time.

Preemptive scheduling adds real overhead (context switches cost real CPU time, and shared data structures need protection from being modified mid-update by an interrupted process, which is exactly why process synchronization matters so much on preemptive systems), but it's what makes responsive, interactive multitasking possible at all.

## A worked example illustrating the difference

Three processes arrive: P1 (needs 10 seconds, arrives first), P2 (needs 1 second, arrives right after P1 starts), P3 (needs 1 second, arrives right after P2).

**Non-preemptive:** P1 starts and runs uninterrupted for its full 10 seconds, since nothing can take the CPU away from it early. P2 and P3, despite each needing only 1 second, both wait the full 10 seconds for P1 to finish before either of them gets to run at all.

**Preemptive (say, Round Robin with a 2-second time slice):** P1 runs for 2 seconds, then gets preempted so P2 can run. P2 only needs 1 second, so it finishes well within its slice. Then P3 runs and finishes within 1 second too. Only then does P1 resume for its remaining 8 seconds. P2 and P3 both finish far sooner than they would have under the non-preemptive version, at the cost of a couple of extra context switches.

## Where this matters in real systems

Every modern general-purpose operating system (Linux, Windows, macOS) uses preemptive scheduling, precisely because users expect their mouse clicks and keystrokes to feel instantaneous even while a heavy background task (a video export, a large compile) is also running. Real-time operating systems used in safety-critical embedded systems also rely heavily on preemption, specifically so a genuinely urgent event (a sensor reading that must be handled within a strict deadline) can always interrupt lower-priority work immediately.

## What interviewers actually ask about preemptive vs non-preemptive scheduling

- **"What's the core difference between preemptive and non-preemptive scheduling?"** Preemptive scheduling can forcibly interrupt a running process before it finishes or voluntarily yields; non-preemptive scheduling cannot, a process always runs to completion or until it blocks on its own.
- **"Give an example of each."** FCFS and non-preemptive SJF are non-preemptive; Round Robin and SRTF are preemptive.
- **"What real cost does preemption introduce?"** Context-switching overhead, and the need for synchronization mechanisms to protect shared data from being modified mid-update when a process is interrupted.
- **"Why do virtually all modern general-purpose operating systems use preemptive scheduling?"** Because users expect interactive responsiveness (fast reaction to input) even while other, longer processes are also running, which non-preemptive scheduling cannot guarantee.

## Key takeaways

- Non-preemptive scheduling never interrupts a running process before it finishes or blocks voluntarily.
- Preemptive scheduling can forcibly reclaim the CPU from a running process at any time.
- Preemption adds context-switch and synchronization overhead but is essential for interactive responsiveness.
- Virtually all modern general-purpose and real-time operating systems use preemptive scheduling.

## Related

- [Previous: Scheduling Queues](https://devsunite.com/resources/core-subjects/operating-systems/scheduling-queues)
- [Next: Scheduler vs Dispatcher](https://devsunite.com/resources/core-subjects/operating-systems/scheduler-vs-dispatcher)
- [More in Process Scheduling: Process Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/process-scheduling)
- [More in Process Scheduling: Scheduling Criteria](https://devsunite.com/resources/core-subjects/operating-systems/scheduling-criterias)
- [More in Process Scheduling: FCFS (First Come First Served) Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/fcfs-scheduling)
- [More in Process Scheduling: Shortest Job First (SJF) Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/sjf-scheduling)
- [More in Process Scheduling: SRTF (Shortest Remaining Time First) Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/srtf-scheduling)
- [More in Process Scheduling: Priority Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/priority-scheduling)
- [More in Process Scheduling: Round Robin Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/round-robin-scheduling)
- [More in Process Scheduling: Multilevel Queue Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/multilevel-queue-scheduling)
- [More in Process Scheduling: Multilevel Feedback Queue Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/multilevel-feedback-queue-scheduling)
- [More in Process Scheduling: Starvation and Aging in Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/starvation-and-aging)
- [All 205 OS interview questions](https://devsunite.com/resources/core-subjects/operating-systems)
