---
title: "Preemptive vs non-preemptive; real-time scheduling"
subject: "Operating System"
chapter: 2
key: "semester_6/operating_system:preemptive-nonpreemptive-realtime"
source: https://www.bctengineer.com/q/semester_6/operating_system/preemptive-nonpreemptive-realtime
site: BCT Engineering
---

# Preemptive vs non-preemptive; real-time scheduling

Operating System · Chapter 2: Process Management

- Asked in: 2068 Bhadra, 4+4 marks
- Video: [Preemptive vs Non-Preemptive Scheduling Explained with Examples | OS | L-9](https://www.youtube.com/watch?v=EpIETrpBWMs) — Concept Core
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/preemptive-nonpreemptive-realtime
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-2

## Question

Describe the difference between preemptive and non-preemptive scheduling algorithm. Explain about scheduling in real time.

## Short answer

Non-preemptive scheduling lets a process hold CPU until it blocks or finishes; preemptive can forcibly take CPU away for shorter response. Real-time scheduling uses preemptive priority to meet deadlines: Rate Monotonic gives highest priority to shortest period, Earliest Deadline First runs task with nearest deadline, schedulable up to 100% CPU.

## Answer

#### Preemptive vs non-preemptive scheduling

In **non-preemptive** scheduling, once the CPU is given to a process it keeps it until it terminates or blocks for I/O; the OS cannot take the CPU away. In **preemptive** scheduling, the OS can forcibly take the CPU from a running process (when its time slice expires or a higher-priority process arrives) and give it to another.

| Basis | Preemptive | Non-preemptive |
|---|---|---|
| CPU release | OS can take the CPU away at any time | Only on termination or voluntary wait |
| Response time | Good for interactive use | Poor; a long job delays others (convoy effect) |
| Overhead | More context switches | Less overhead |
| Shared data | Needs synchronization (race conditions) | Simpler; no races caused by preemption |
| Starvation | Possible for low-priority processes (preemptive priority) or long jobs (SRTF) | Possible for long or low-priority jobs in SJF and non-preemptive priority; none in FCFS |
| Algorithms | Round robin, SRTF, preemptive priority | FCFS, SJF, non-preemptive priority |
| Hardware | Needs a timer interrupt | No timer needed |

#### Scheduling in real time

A real-time system must produce results within given **deadlines**. Tasks may be *periodic* (repeating every period P with execution time E) or *aperiodic/sporadic*. Real-time systems are **hard** (a missed deadline is a failure) or **soft** (a miss only lowers quality).

Real-time scheduling algorithms can be **static** (priorities fixed before run time) or **dynamic**:

- **Rate Monotonic (RM)**: static; the task with the shortest period gets the highest priority; preemptive. A task set is guaranteed schedulable if CPU utilisation U = Σ(Eᵢ/Pᵢ) ≤ n(2^(1/n) − 1) (about 69% for large n).
- **Earliest Deadline First (EDF)**: dynamic; the task with the nearest absolute deadline runs first. Schedulable if U ≤ 1 on one CPU.
- **Least Laxity First**: runs the task with the smallest slack time.

Real-time scheduling should be preemptive and priority based, with small and bounded interrupt latency and dispatch time. The scheduler may also use admission control (accepting a task only if its deadline can be guaranteed).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is preemptive scheduling?
   A. A process keeps the CPU until it finishes or blocks
   B. No timer is needed
   C. The OS can forcibly take the CPU from a running process, e.g. at time slice expiry or higher-priority arrival
   D. The CPU is never switched
   Answer: C. That is the opposite of non-preemptive. (Key point: Preemptive definition)

2. Which needs synchronization of shared data?
   A. Non-preemptive scheduling always
   B. Neither
   C. Only FCFS
   D. Preemptive scheduling, because of possible race conditions
   Answer: D. Preemption can interrupt in the middle of shared-data updates. (Key point: Race conditions)

3. In Rate Monotonic scheduling, which task gets the highest priority?
   A. The one with the shortest period
   B. The one with the nearest absolute deadline
   C. The one with the longest period
   D. The one with the smallest slack
   Answer: A. RM is static; EDF uses the nearest deadline. (Key point: Rate Monotonic)

4. When is a task set schedulable by EDF on one CPU?
   A. When U <= 0.5
   B. When utilisation U = sum(Ei/Pi) <= 1
   C. When U <= 69% only
   D. When U >= 1
   Answer: B. EDF is optimal on a single CPU up to 100% utilisation. (Key point: EDF schedulability)

## Related in Operating System

- [Real-time scheduling; two-processor numerical](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Arealtime-two-processor-fcfs-sjf-priority-rr) — Operating System, chapter 2
- [Preemptive vs non-preemptive; process states](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Apreemptive-nonpreemptive-process-states) — Operating System, chapter 2
- [Rate Monotonic real-time schedule](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Arate-monotonic-schedule) — Operating System, chapter 2
- [RR, preemptive priority, preemptive SJF](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aprocess-rr-priority-preemptive-sjf) — Operating System, chapter 2
- [Preemptive priority and SRTF Gantt](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Apreemptive-priority-srtf-gantt) — Operating System, chapter 2
- [Disk scheduling: FCFS, SSF, SCAN at 53](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Adisk-200-cyl-fcfs-ssf-scan-53) — Operating System, chapter 6, asked 3×

## Related in other subjects

- [Non-preemptive priority scheduling (10, 5, 7 ms)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-priority-nonpreemptive-10-5-7) — Embedded System, chapter 6, asked 2×
- [Preemptive priority scheduling (4, 6, 5 ms)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-priority-4-6-5) — Embedded System, chapter 6
- [Non-preemptive SJF with P4 arriving](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-sjf-nonpreemptive-6-8-2) — Embedded System, chapter 6, asked 2×
- [Preemptive priority scheduling with P4 (6 ms)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-priority-10-5-7-p4) — Embedded System, chapter 6, asked 2×
