19-Soft-A4 Real-Time Systems · Undated paper
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Note. Pages 3–4 print the same question stem three times side by side with only the supporting data table changed. The six distinct question stems are solved once each below, using the first data variant printed for each; the repeated variants are noted at the end of the relevant question.
National Exams — 04-Soft-A4 Real-Time Systems. Three-hour, closed-book exam (Casio or Sharp approved calculators only). Cover page states: "Any five questions constitute a complete paper. Only the first five questions as they appear in your answer book will be marked. All questions are of equal value (20% each)." All six distinct questions recovered from the source are solved below for completeness. Where a doubt exists as to interpretation, the candidate is expected to state assumptions — engineering assumptions used below are flagged in check callouts.
Reference texts: Jane W. S. Liu, Real-Time Systems (Prentice Hall, 2000) — task models, timing requirements, FCFS/EDF and priority scheduling; Giorgio C. Buttazzo, Hard Real-Time Computing Systems: Predictable Scheduling Algorithms and Applications (Springer, 3rd ed.) — preemptive fixed-priority and dynamic-priority scheduling; Hermann Kopetz, Real-Time Systems: Design Principles for Distributed Embedded Applications (Springer, 2nd ed.) — distributed real-time control, network-induced delay; Katsuhiko Ogata, Modern Control Engineering (Pearson, 5th ed.) — frequency-domain stability, phase margin, transport-lag systems; Ian Sommerville, Software Engineering (Pearson, 10th ed.) — general software-engineering process context.
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
(a) Typical features of an RTOS. A real-time operating system is distinguished from a general-purpose OS by a small set of properties that all serve predictability rather than average-case throughput: (i) a deterministic, priority-based preemptive scheduler (fixed-priority such as Rate-Monotonic, or dynamic-priority such as EDF) with bounded, analyzable worst-case scheduling latency; (ii) bounded interrupt-latency and bounded, short interrupt-service-routine execution; (iii) priority inheritance or priority-ceiling protocols to bound priority inversion when tasks share resources via mutexes; (iv) a small, deterministic kernel footprint with system calls that execute in bounded time (no unbounded-latency operations such as unrestricted disk paging in the critical path); (v) precise, high-resolution clock and timer services for periodic task release; and (vi) predictable, minimal memory management (often static allocation or a fixed-latency allocator, avoiding a general-purpose garbage collector's unpredictable pause times).
(b) Why RTOSs are used in real-time applications. A real-time application's correctness depends on meeting deadlines, not merely on eventually producing the right answer; a general-purpose OS optimizes for average throughput and fairness, which can let a low-priority-looking-but-urgent task be starved by scheduling policies, page-fault stalls, or unbounded system-call latency. An RTOS is used specifically because it provides the analyzability needed to prove, before deployment, that every task's worst-case response time is within its deadline (schedulability analysis) — something a general-purpose scheduler's best-effort, throughput-oriented policies cannot guarantee.
(c) Hard vs. soft real-time systems — careful definitions. A hard real-time system is one in which every task has a deadline whose violation constitutes a system failure — the correctness of the system is defined jointly by logical correctness and timeliness, and a late (even if logically correct) result is treated as a wrong result; hard-real-time designs therefore require a schedulability guarantee for the absolute worst case, not merely the common case. A soft real-time system is one in which deadlines express a desired quality of service rather than a correctness requirement: a late result retains partial value that degrades (often continuously) with lateness, and occasional missed deadlines are tolerated as a quality trade-off rather than treated as failures — schedulability is typically analyzed statistically (e.g. bounding the fraction of missed deadlines) rather than for the absolute worst case.
(d) Fundamental differences between real-time and non-real-time systems.
| Aspect | Real-time system | Non-real-time system |
|---|---|---|
| Correctness criterion | Logical correctness and timeliness (deadline) | Logical correctness only |
| Performance goal | Predictability / bounded worst-case response | High average throughput |
| Scheduling | Deterministic, priority- or deadline-based, analyzable | Best-effort, fairness- or throughput-oriented |
| "Faster is better"? | Not necessarily — a slow system that reliably meets its deadline is correct; an average-fast system with occasional long tails may not be | Yes — minimizing average/response time is generally the direct goal |
| Resource management | Static/bounded-latency allocation, priority inheritance to bound blocking | Dynamic allocation, general-purpose caching/paging, garbage collection |