Both schedulers always pick the highest-priority task that is ready. They differ in one thing: when they are allowed to pick. A preemptive scheduler decides again every time a task is released. A non-preemptive scheduler decides only when the processor becomes free. The same task set runs under both below; step through time and watch where they part.
Once a task starts, it runs to completion. Everyone else waits.
A newly released task with higher priority takes the processor at once.
Both schedules are hidden. Tick one below to show it.
Non-preemptive
Preemptive
| Task | Release | Execution time | Priority | Deadline (after release) |
|---|
Time is in whole units. Leave a deadline empty for none. Equal priorities are served in release order and do not preempt each other.
| Task | Deadline | Non-preemptive | Preemptive |
|---|
Response time = finish time − release time.
What preemption buys. A high-priority task never waits for a lower-priority one, so its response time depends only on itself and the tasks above it.
What it costs. Each preemption is an extra context switch, and a task can be interrupted halfway through updating shared data, so shared resources need protecting.
Blocking without preemption. A task can be held up by at most one lower-priority task, for as long as that task still has to run. One long low-priority task is enough to break a tight deadline.