The idea: prove every deadline is met before the system runs
A control loop, a sensor reader or an audio callback runs again and again at a fixed rate. Each one is a periodic task τi = (Ci, Ti, Di): every Ti ticks it releases a job that needs Ci ticks of CPU (its worst-case execution time) and must finish within Di ticks of the release, its deadline. Usually D = T: a job must be done before the next one arrives. The scheduler uses fixed priorities and preempts at once, as SCHED_FIFO on Linux does. The question this page answers is the one an engineer must settle before shipping: with these priorities, can any job ever miss its deadline? There are two tests on paper, a quick one and an exact one, and the page checks both against the real schedule.
Rate-monotonic priorities
Rate-monotonic (RM) priorities are simple: the shorter the period, the higher the priority. On the page's set A, τ1 (C = 1, T = 4) gets priority 1, τ2 (C = 2, T = 6) priority 2 and τ3 (C = 3, T = 12) priority 3. Liu and Layland proved in 1973 that, when every deadline equals the period, RM is optimal among fixed-priority orders: if any fixed order meets every deadline, RM does too. The wrong order shows why it matters. Give the longest period the top priority and τ3 takes ticks 0–2, τ2 ticks 3–4, and τ1, which needs one tick out of every four, has not run by tick 4 (Demo: wrong priorities, longest period first: τ1 misses at ticks 4 and 8). With RM priorities the same set meets every deadline.
The utilization bound
The utilization U = Σ Ci/Ti is the share of the CPU the tasks ask for. Above 1, no scheduler can keep up. Liu and Layland's bound gives a quick sufficient test for RM with D = T:
For n = 2 tasks the bound is 0.828, for 3 tasks 0.780, and it falls towards ln 2 ≈ 0.693 as n grows. Set D, U = 1/4 + 1/6 + 2/12 = 0.583, is under 0.780, so every deadline is met without further work (Demo: under the bound, set D). Set A has U = 1/4 + 2/6 + 3/12 = 0.833, above 0.780 but below 1. The test is only sufficient: above the bound it says nothing at all, neither "safe" nor "unsafe" (Demo: utilization test, set A).
Response-time analysis
The exact test computes each task's worst-case response time Ri, the longest time from a release to the end of that job. A job of τi is delayed only by higher-priority tasks, and in a window of R ticks a task τj is released ⌈R/Tj⌉ times. So R must satisfy
R appears on both sides, so it is found by iteration. Start from R⁰ = Ci plus one job of every higher-priority task, put the value into the right side, and repeat until it stops changing (then Ri ≤ Di ✓) or passes Di (✗). For τ3 in set A (Demo: response-time analysis, set A):
| step | window | τ1 releases | τ2 releases | R = 3 + τ1 work + τ2 work |
|---|---|---|---|---|
| R⁰ | – | 1 | 1 | 3 + 1 + 2 = 6 |
| R¹ | 6 | ⌈6/4⌉ = 2 | ⌈6/6⌉ = 1 | 3 + 2 + 2 = 7 |
| R² | 7 | ⌈7/4⌉ = 2 | ⌈7/6⌉ = 2 | 3 + 2 + 4 = 9 |
| R³ | 9 | ⌈9/4⌉ = 3 | ⌈9/6⌉ = 2 | 3 + 3 + 4 = 10 |
| R⁴ | 10 | ⌈10/4⌉ = 3 | ⌈10/6⌉ = 2 | 3 + 3 + 4 = 10, the same: stop |
R3 = 10 ≤ 12 ✓, and τ1 (R = 1) and τ2 (R = 2 + ⌈3/4⌉·1 = 3) pass too. Set A is schedulable although its U is above the bound.
The critical instant and the hyperperiod
Why does a formula stand for every job? Liu and Layland showed that a task's worst response happens at the critical instant, when it is released together with every higher-priority task. The page releases all tasks at t = 0, so the first job of each task is its worst one. The schedule repeats every hyperperiod H = lcm(Ti), 12 ticks for set A, so one hyperperiod shows everything (Demo: RM schedule over the hyperperiod: τ1 at tick 0, τ2 at 1–2, τ3 at 3, preempted by τ1 at 4, on at 5, preempted by τ2 at 6–7 and τ1 at 8, done at 10; the worst response times seen are 1, 3 and 10, exactly the analysis, and the CPU idles 2 of 12 ticks).
When the test fails: set B
Set B has τ1 (C = 2, T = 5) and τ2 (C = 4, T = 7): U = 0.4 + 0.571 = 0.971, above the two-task bound 0.828. The analysis gives R⁰ = 6, then R¹ = 4 + ⌈6/5⌉·2 = 8 > 7 ✗. The schedule agrees (Demo: set B misses a deadline): τ1 runs 0–1, τ2 2–4, τ1 is released again at 5 and takes 5–6, and at tick 7 τ2 still has one tick of work left. It finishes late, at 8. In the rest of the 35-tick hyperperiod no other job misses: one miss is enough to fail a hard real-time system. Swapping the priorities does not help either (τ1 would then wait 4 ticks for τ2 and finish at 6 > 5), so no fixed order schedules set B. A dynamic-priority scheduler such as earliest deadline first (EDF) meets every deadline whenever U ≤ 1, at the cost of priorities that change from job to job.
Deadlines shorter than periods: deadline-monotonic
If a task must react faster than it repeats (D < T), the utilization bound does not apply. Set C adds a sensor task τ3 with C = 1, T = 12 but D = 2. Its U is only 0.667, under 0.780, yet under RM τ3 has the lowest priority and its first job waits for τ1 and τ2 until tick 3: it misses at tick 2 (Demo: D < T, rate-monotonic fails; the analysis gives R⁰ = 4 > 2 ✗). Deadline-monotonic (DM) priorities order tasks by D instead of T. Leung and Whitehead proved in 1982 that DM is the optimal fixed order when D ≤ T. Now τ3 runs first and the response times are τ3 1, τ1 2, τ2 4, all within their deadlines (Demo: deadline-monotonic fixes it). When D = T, DM and RM are the same order.
| test | what it needs | answer | cost |
|---|---|---|---|
| U ≤ n(21/n − 1) | RM priorities, D = T | "yes" or "don't know" | one sum |
| U ≤ 1 | any scheduler | "no" if U > 1 | one sum |
| response-time analysis | any fixed priorities, D ≤ T | exact yes or no | a few iterations per task |
| simulate one hyperperiod | release times known | exact for that release pattern | H ticks (can be huge) |
See also real-time scheduling (SCHED_FIFO and SCHED_RR, priority inversion and the Mars Pathfinder), CPU scheduling (FCFS, SJF, round robin and CFS on the same processes) and preemptive vs cooperative scheduling.
See also EDF vs least slack, where set B meets every deadline under earliest deadline first and an overloaded set shows EDF's domino effect.
See also interrupt priorities and nesting for what fixed priorities and preemption cost on a microcontroller, counted in cycles.
See also a time-triggered co-operative scheduler, the simpler non-preemptive alternative on small microcontrollers, where offsets keep every tick's work under 10 ms.
See also the CAN bus, where fixed message priorities decide who sends first, just as fixed task priorities do here.
See also the cyclic executive, which fixes the whole schedule in a table of frames before the system runs instead of using priorities.
See also embedded software architectures for why a preemptive RTOS gives the top-priority task a response of almost nothing while a super loop makes it wait for every handler.
See also priority ceiling protocols and the stack resource policy, which adds the blocking term B to response-time analysis and shows a task set that fails under priority inheritance but passes under a ceiling protocol.
What the page leaves out
One CPU, integer ticks, and a context switch that takes no time; real analyses add switch and interrupt costs to C. Tasks here never block or share resources, so there are no blocking terms in the formula; locking protocols that bound blocking (priority inheritance, priority ceiling) are a separate topic. Jobs never start late (no release jitter), never run shorter than C, and never arrive sporadically. The page does not cover EDF in depth, clock-driven tables (cyclic executives), deadlines longer than periods, the hyperbolic bound, or multiprocessor scheduling.