Elio Saade
Note

Preemptive vs. Non-Preemptive Scheduler

Topics: Embedded Systems

Preemptive

A preemptive scheduler may interrupt the current task to dispatch another task that typically requires a higher priority.

Advantages

  • Distributes resources better, so one processes cannot hog CPU
  • Can help meet deadlines better in hard real-time

Disadvantages

  • More complex to implement
  • Higher context switching overhead
  • High priority tasks might utilize most of CPU
  • Concurrency issues when using mutexes and semaphores

Non-Preemptive

In a non-preemptive scheduler, the current task runs until it finishes before another task is dispatched.

Advantages

  • Simpler to implement
  • Low scheduling and context switching delay

Disadvantages

  • One long-running task can occupy all CPU
  • Average response time is higher

References

  1. https://industrialmonitordirect.com/blogs/knowledgebase/preemptive-vs-non-preemptive-scheduling-in-rtos-explained?srsltid=AU7gw4UT8dnUMYSSxHxRECKxzdM4c5WQVZUOTU_j1iFhDpz-FXWixrbF
  2. https://www.geeksforgeeks.org/operating-systems/preemptive-and-non-preemptive-scheduling/

Connections

Direct relationships to this note.