The real-time scheduler is the component of a real-time operating system that answers, at every moment, the question: which task should the processor run right now? In a system with deadlines, this decision is not about fairness or average throughput but about making sure the work that must finish on time actually does. The scheduler is therefore the part of an RTOS most directly responsible for its determinism.
The most common approach in practical RTOSes is fixed-priority preemptive scheduling. Every task is given a priority when it is created, and the scheduler always runs the highest-priority task that is ready. The FreeRTOS Kernel Book states the rule plainly: the scheduler always ensures the highest-priority task that can run is the one selected to run, and a higher-priority task entering the ready state immediately preempts a lower-priority running task. Preemption means the scheduler can interrupt a running task at any time, not only at a periodic tick, which is what keeps urgent work from waiting behind less important work.
The theoretical foundation for fixed-priority real-time scheduling comes from Liu and Layland’s 1973 paper in the Journal of the ACM, “Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment.” That paper analyzed the single-processor problem from the standpoint of tasks needing guaranteed service. It showed that an optimum fixed-priority scheduler has an upper bound on processor utilization, and that full utilization can instead be reached by assigning priorities dynamically according to which deadline is nearest, the scheme now called earliest deadline first.
These two families, fixed-priority and deadline-driven, define the choices a real-time scheduler designer faces. Fixed-priority scheduling is simpler, easier to reason about, and the default in most commercial and open-source RTOSes; earliest-deadline-first squeezes out more processor utilization but is more complex to implement and analyze. Both depend on knowing the timing behavior of tasks in advance so that a schedulability test can prove the deadlines will be met.
Scheduling also exposes real-time computing’s subtlest failures. When a high-priority task is forced to wait on a resource held by a lower-priority one, the result is priority inversion, the bug that famously stalled the Mars Pathfinder lander. Understanding the scheduler is therefore inseparable from understanding how real-time guarantees can quietly break.