Real-Time Systems and Scheduling
- 74Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What two aspects help define a real-time system?
Its functional behavior and its temporal behavior.
Or swipe the card
74 cards
What two aspects help define a real-time system?
Its functional behavior and its temporal behavior.
What does timeliness mean for a real-time operating system?
The ability to handle tasks according to their time constraints and deadlines.
How is performance evaluated differently in real-time systems than in general-purpose systems?
Real-time performance focuses on whether each individual job meets its deadline, rather than on average response time or throughput.
What is predictability in a real-time system?
The ability to estimate or guarantee how long tasks or jobs will take and whether their deadlines can be met.
Is fast execution the same as predictable execution?
No. A system can be fast but unpredictable; real-time systems prioritize predictability.
What characterizes a soft real-time system when a deadline is missed?
The task loses value after its deadline; in the described model, that value declines linearly until it reaches zero.
What characterizes a firm real-time system when a deadline is missed?
A late result has no value, but missing the deadline does not itself cause a severe penalty.
What characterizes a hard real-time system when a deadline is missed?
Missing a deadline can cause serious harm and incurs negative utility or a penalty.
How do example applications compare across the real-time spectrum?
Scientific simulations are usually not real-time; user interfaces have responsiveness expectations; cruise control is soft real-time; engine and flight control can be hard real-time.
What key properties, beyond predictability and timeliness, are desirable in a real-time operating system?
Fault tolerance, peak-load handling, and maintainability.
What does fault tolerance mean in the context of a real-time system?
A fault should be isolated and handled without causing the entire system to crash.
Why can DMA create a timing problem in a real-time system?
The I/O device and CPU may share a memory bus, so heavy device traffic can delay CPU access and backlog high-priority work.
How can time-slicing a shared memory bus improve predictability?
It guarantees the CPU and I/O devices particular bus-use intervals, allowing the CPU to estimate its access opportunities.
Why are caches useful in general-purpose systems?
They keep recently used data close to the processor so subsequent accesses can be faster.
Why can caches undermine predictability in a real-time system?
Access time depends on whether the needed data is cached; a cache miss takes longer than a hit.
What is one way to avoid timing uncertainty caused by caches?
Use a processor without caches or disable caches.
Why might assuming a cache miss for every access not solve all real-time timing concerns?
Although it can provide a worst-case bound for an individual task, varying execution times across dependent tasks can make analyzing the workload as a whole very difficult.
Why can a non-preemptive system-call handler cause a missed real-time deadline?
If interrupts are disabled while the handler runs, a newly ready high-priority task cannot take the processor until the handler finishes.
How do system calls and interrupts differ in how they are initiated?
System calls are synchronous and initiated by the running task; interrupts arrive asynchronously from external events.
Why can long interrupt handlers be harmful to real-time tasks?
Handling an interrupt can delay the task that was running, potentially causing it to miss its deadline.
Why is allowing interrupt handlers to preempt one another problematic?
A stream of further interrupts could repeatedly preempt handling of an earlier interrupt, delaying its completion.
What is one approach to avoiding unpredictable interrupt interference?
Disable interrupts other than the timer interrupt and have each task handle its own I/O by polling.
What are two advantages of having each task handle its own I/O by polling?
Task execution becomes more predictable, and the kernel does not need changes when a device is added.
What are two disadvantages of putting I/O device logic in every task?
Polling wastes CPU time, and device changes require programmers to update the affected tasks.
How does periodic kernel polling handle I/O?
With device interrupts disabled except for the timer, periodic kernel routines poll the devices and handle any available data.
What is an advantage of placing periodic I/O polling routines in the kernel?
Device-specific details stay modular and do not need to be included in every task.
What are disadvantages of periodic kernel polling?
It still wastes CPU time, device changes require kernel changes, and I/O may require extra communication and delay through the kernel.
What is the lightweight-interrupt approach used in many real-time operating systems?
Keep interrupt handlers and device drivers minimal; have them create or wake a task to perform the substantive work.
What is the main benefit of assigning I/O work to tasks activated by lightweight handlers?
It avoids busy waiting while keeping interrupt handling short, so the work can be scheduled and analyzed as tasks.
What costs remain with lightweight interrupt handlers and device tasks?
Communication is needed to transfer data, and some delays from device handling may remain unbounded, though the risk is reduced by keeping handlers short.
Why do general-purpose operating systems use separate virtual address spaces for processes?
To provide process protection and isolation.
What role does a page table play in virtual memory?
It maps virtual pages to physical pages.
What is a translation lookaside buffer (TLB)?
A small processor-near cache that stores recent virtual-to-physical address translations.
How can TLB hits and misses affect real-time predictability?
A hit makes translation fast, while a miss requires a slower memory lookup, creating variable timing.
What is one way real-time systems avoid variability from virtual-memory translation?
Avoid virtual memory and use physical memory directly.
Why may direct physical-memory use be acceptable in some real-time or embedded systems?
Such systems may be designed for a single user and a specific task, making process isolation less necessary.
What is paging in a virtual-memory system?
Using physical memory as a cache for pages stored on disk, bringing needed pages into memory and evicting others when space runs out.
Why is paging problematic for real-time tasks?
Disk transfers to evict and load pages take a long time and make execution timing unpredictable.
How can pinning pages help a real-time task?
Pinned pages are kept in physical memory and cannot be evicted, preventing that task's pages from being paged to disk.
Why can dynamic memory allocation be unpredictable?
Allocation algorithms such as first fit or best fit may take different amounts of time depending on where suitable free memory is found.
What is external fragmentation, and why can it cause an allocation to fail?
Free memory is split into separated regions, so a request for one contiguous block may fail even when the total free memory is sufficient.
Why may a memory allocator be unable to defragment memory by moving allocated blocks?
The program may have copied pointers to those blocks, and the allocator cannot track and update every copy.
How can fixed-size memory blocks help make allocation more predictable, and what cost can they introduce?
They avoid variable-size allocation searches, but can waste unused space inside an allocated block (internal fragmentation).
Why do some real-time systems prohibit dynamic memory allocation?
Static allocation improves predictability, even though it reduces flexibility.
Why can recursion make real-time execution difficult to guarantee?
If recursion depth depends on runtime input, the number of calls and total execution time may be unbounded.
What examples of programming languages designed for real-time use were mentioned?
Real-time Java and other real-time programming languages.
What is the main scheduling goal in a general-purpose operating system compared with a real-time system?
General-purpose scheduling often seeks high throughput or average performance; real-time scheduling focuses on individual tasks and worst-case response times.
What is a periodic task?
A task whose jobs arrive repeatedly at a fixed period.
What timing parameters characterize a periodic task?
Its period, each job's worst-case execution time, and its relative deadline.
What is the usual relative deadline of a periodic task if none is specified?
The task's period.
How is the utilization of a periodic task calculated?
As its job's worst-case execution time divided by the task's period: Ui=Ci/Pi.
What is the difference between a task and a job?
A task is the recurring high-level activity; a job is one instance or arrival of that task.
How do periodic, aperiodic, and sporadic tasks differ?
Periodic tasks arrive at fixed intervals; aperiodic tasks arrive irregularly without hard deadlines; sporadic tasks arrive irregularly but have hard deadlines.
What two properties can describe how tasks relate and execute?
Tasks may be independent or dependent, and they may be preemptible or non-preemptible.
What is a static scheduling policy?
A policy that assigns priorities to tasks, with each task's priority fixed over time.
What is a dynamic scheduling policy in the task/job priority classification?
A policy that assigns fixed priorities to individual jobs; different jobs of the same task may receive different priorities.
What is fully dynamic scheduling?
A policy in which the priority assigned to a job can change over time.
When is a schedule feasible?
When every task or job in it meets its deadline.
When is a task set schedulable under a scheduling class?
When some algorithm in that class can produce a feasible schedule for the task set.
What does it mean for a scheduling algorithm to be optimal with respect to a class?
It produces a feasible schedule for every task set that is schedulable by some algorithm in that class.
How does rate-monotonic scheduling assign priorities?
It assigns fixed task priorities, giving higher priority to tasks with shorter periods.
What assumptions are used for the basic rate-monotonic scheduling discussion?
Tasks are periodic and independent, and their worst-case execution times are known in advance.
In what sense is rate-monotonic scheduling optimal?
It is optimal among static-priority schedulers: if any static scheduler can feasibly schedule a task set, rate-monotonic scheduling can too.
What is the rate-monotonic utilization bound for n periodic tasks?
A sufficient condition for guaranteed feasibility is ∑i=1nUi≤n(21/n−1).
What does the rate-monotonic utilization bound tell you when total utilization exceeds the bound?
It gives no guarantee: rate-monotonic scheduling may succeed or fail.
How does the rate-monotonic utilization guarantee change as the number of tasks increases?
The bound n(21/n−1) decreases as the number of tasks increases.
In the illustrated three-task rate-monotonic example, what does total utilization of about 0.98 imply when the bound is about 0.78?
The utilization test provides no guarantee, and the example's rate-monotonic schedule misses a deadline.
Why can round-robin scheduling miss real-time deadlines?
It does not prioritize jobs according to their deadlines, so a job may wait too long despite receiving turns in rotation.
How does earliest-deadline-first (EDF) assign priorities?
It assigns priorities to jobs, giving the highest priority to the job with the earliest deadline.
How does EDF's priority assignment differ from static task-priority scheduling?
EDF prioritizes individual jobs by their deadlines, so jobs from the same task can receive different priorities.
In what sense is EDF optimal?
Among online schedulers, if any scheduler can feasibly schedule a task set, EDF can also do so.
Why is EDF useful for task sets that rate-monotonic scheduling cannot feasibly schedule?
EDF can feasibly schedule a task set whenever any online scheduler can, even if rate-monotonic scheduling fails.
What does it mean for a scheduler to be online?
It schedules tasks as the workload unfolds rather than relying on a fixed schedule prepared in advance.
Why are offline schedulers excluded from the online optimality comparison described for EDF?
An offline schedule is prepared in advance as a fixed table, so it does not provide the same dynamic scheduling comparison.

Ask anything
We've read this whole study set, so questions about it get the best answers.