5.5.12 · D5Embedded Systems & Real-Time Software

Question bank — Real-time constraints — hard and soft deadlines

2,138 words10 min readBack to topic

Before the traps, we build the five symbols they all lean on — from scratch, on a picture — so this page stands on its own.


The symbols, on one timeline

Every question below talks about tasks running on a single CPU. A task is a piece of code (say, "read the sensor") that gets released again and again. Each release is called a job. Picture time flowing left→right; each job is a stopwatch that starts when the job is released and stops when it finishes.


Where the exact test comes from — a picture, not a formula drop

The utilisation bound is only a rough gate. The exact question "does task ever miss?" is answered by watching how many times higher-priority tasks shove ahead of it. Let mean "the set of tasks with higher priority than ". Under Rate-Monotonic, those are the ones with shorter periods.


True or false — justify

A hard real-time system just needs a very fast CPU.
False. Hard real-time needs a provably bounded worst case, not speed; a fast CPU with unbounded pauses (garbage collection, cache misses) can miss deadlines a slow-but-deterministic MCU never would.
If total utilisation , any task set is schedulable.
False. only means the CPU is not physically over-subscribed; under fixed-priority scheduling worst-case phasing wastes CPU, so you may need (as low as ).
Failing the Liu–Layland RM bound proves the task set is unschedulable.
False. The bound is sufficient, not necessary — many sets above the bound still meet every deadline; you must run exact Response-Time Analysis to be certain.
A firm deadline miss and a soft deadline miss are equally harmful.
False. A firm miss makes the result worthless so you discard it (value = 0); a soft miss leaves reduced but nonzero value, so you keep the late result.
EDF can schedule any single-processor periodic set with .
True (when each ). EDF is optimal for periodic tasks on one CPU, so it meets all deadlines exactly when under the implicit-deadline model — the full processor is usable.
Using average execution time instead of WCET gives a safe schedulability verdict.
False. Deadlines are missed in the worst case; averages under-count demand and produce a falsely "safe" answer, so you must use WCET .
A missed deadline in a soft real-time system is a system error.
False. In soft real-time occasional misses are tolerated by design; the goal is bounding statistics (e.g. 99.9% on time), not proving zero misses.
Rate-Monotonic assigns higher priority to tasks with longer periods.
False. RM gives higher fixed priority to shorter periods (higher frequency), because those tasks have less slack before their next release.
If every task's response time equals its WCET, the CPU has no preemption happening.
True. collapses to only when the interference sum is zero, meaning no higher-priority task preempted it.

Spot the error

"We tested the loop 10,000 times and it always finished in time, so the hard deadline is guaranteed."
Testing measures observed cases, not the worst case; a hard guarantee needs a proof (WCET + schedulability test), because the untested worst path may still exist.
"Our utilisation is for , which fails the RM bound , so we must redesign."
Failing the sufficient RM bound does not prove unschedulability; run exact Response-Time Analysis first — the set may still meet all deadlines.
"We used average CPU cost in the utilisation sum and got , safely schedulable."
The utilisation test requires WCET, not average cost; with real worst-case values could exceed the bound and deadlines could be missed.
"Deadline equals period, so we can ignore the period in the analysis."
The period still governs how often the task releases and how often higher-priority tasks preempt it (the term), so it cannot be ignored even when .
"A late video frame should be buffered and shown as soon as it arrives."
A video frame is a firm deadline — once its display slot passes it has zero value and should be discarded, not shown late, which would corrupt playback timing.
"Since our airbag controller usually fires in 5 ms and the deadline is 20 ms, we have huge margin."
"Usually" is irrelevant for a hard deadline; the guarantee must hold for the worst-case execution () and worst-case interference, not the typical run.
"We raised the CPU clock, so priority inversion is no longer a concern."
A faster clock does not remove unbounded blocking — a low-priority task holding a lock still stalls a high-priority one; you need priority inheritance, not more MHz.
"Our tasks arrive on a strict fixed period, so their arrivals are jitter-free by definition."
A periodic model assumes perfect spacing , but real releases suffer arrival jitter; if arrivals can bunch up (a sporadic/jittery model), your worst-case interference is higher than the pure-periodic analysis predicts.

Why questions

Why does correctness in real-time include when, not just what?
Because a logically correct result delivered after its deadline can be useless or dangerous (e.g. firing an airbag after the crash), so timeliness is part of the specification.
Why is the RM utilisation bound below while EDF's is exactly ?
Fixed priorities can force the CPU idle at worst-case phasing, wasting capacity; EDF re-decides priority by nearest deadline, so it never idles while work is pending under .
Why does the ceiling appear in Response-Time Analysis?
It counts how many times a higher-priority task is released — and thus preempts task — within the response window , and preemptions come in whole releases so we round up.
Why must Response-Time Analysis be solved by iteration?
appears on both sides (a bigger response window admits more preemptions, which grows the window), so you fix-point iterate from until the value stops changing.
Why does guarantee a missed deadline regardless of scheduler?
Because the tasks collectively demand more than 100% of one CPU's time — a physical impossibility — so no scheduling order can serve all of them on time.
Why is graceful degradation the design knob for soft, not hard, systems?
Soft systems keep partial value under overload (drop quality, skip frames), whereas a hard system must never miss at all, so shedding load is not an acceptable substitute for a proof.
Why does a sporadic task (only a minimum inter-arrival gap) still get analyzed like a periodic one?
Its worst case for the CPU is arriving as fast as allowed, i.e. exactly every minimum-gap; treating that minimum gap as the period gives a safe upper bound on interference.

Edge cases

What happens to schedulability when a single task's WCET is unbounded?
No bound exists, so no hard guarantee is possible; the task must be redesigned to have a finite, analyzable before any test applies.
At exactly , is an RM task set schedulable?
Yes — the bound is the threshold, so equality still passes the sufficient test and guarantees all deadlines.
As , what does the RM utilisation bound approach, and what does that mean?
It approaches , meaning with many tasks you can safely use only ~69% of the CPU under RM in the worst case.
What is the value of a hard-deadline result delivered one instant late?
Effectively (invalid/catastrophic) — a hard deadline is a cliff, so even a tiny overrun is treated as total failure.
If a task's relative deadline is shorter than its period (constrained deadline), does still suffice for EDF?
Not necessarily — the simple bound assumes ; with you need a demand-bound or processor-demand test, since less slack can cause misses even below full utilisation.
If a task's relative deadline is longer than its period (arbitrary deadline), what breaks in the simple analysis?
A new job can be released before the previous job of the same task has finished, so you must track multiple outstanding jobs per task; the plain single-job RTA and the EDF test no longer apply, and a processor-demand / busy-period analysis is required.
For a sporadic task with arrival jitter, which value do we plug in as the effective period to stay safe?
The minimum inter-arrival time (worst-case bunching), because that maximises how often the task preempts others; using the average or nominal spacing would under-count interference and give a false pass.
A soft task that misses by 0 ms (finishes exactly at ) — did it meet its deadline?
Yes — the condition is (inclusive), so finishing exactly at the deadline counts as meeting it, with tardiness .

For the deeper machinery behind these traps, see Worst-Case Execution Time analysis, Rate-Monotonic Scheduling, Earliest Deadline First (EDF), Priority Inversion and Priority Inheritance, Periodic vs Aperiodic Tasks, and Jitter and Latency.

Recall One-line self-test before you leave

Cover the answers and re-do any three items from each section; if you can state the reason (not just the verdict) for all of them, you own this topic.