Explore essential real-time concurrency concepts, including task scheduling algorithms, deadlines, priorities, and timing constraints. Strengthen your understanding of how systems manage concurrent tasks with predictable timing and efficient scheduling techniques.
In a real-time system using rate monotonic scheduling, which tasks are given higher priorities?
Explanation: In rate monotonic scheduling, tasks with shorter periods (i.e., requiring more frequent execution) are assigned higher priorities to ensure timely completion. Tasks with longer execution times may have lower priority unless their period is short. The number of I/O operations does not determine priority. Starting time (when a task starts) is unrelated to the rate monotonic priority assignment.
Under the earliest deadline first (EDF) algorithm, what determines a task’s execution priority?
Explanation: EDF scheduling assigns the highest priority to the task whose deadline is approaching soonest, allowing for dynamic priority changes as deadlines shift. Initial start times may differ from current deadlines and are not the basis for priority. Stack memory usage and waiting times have no direct effect in EDF scheduling.
Which statement accurately describes a hard real-time system?
Explanation: In hard real-time systems, missing a deadline may cause severe consequences, such as system malfunction. In soft real-time systems, late results merely reduce performance, not functionality. Timing is crucial in hard real-time; systems that ignore timing or accept any result do not fit this category.
If a task arrives at time 0 and has a deadline at time 10, which of the following defines its response time?
Explanation: Response time measures how long it takes from when a task arrives to when it finishes. The time between arrivals refers to the period, not response time. Hardware interrupts might increase response time, but are not the definition. Priorities are unrelated to an individual task’s response time.
In preemptive scheduling, what happens if a higher-priority task becomes ready while a lower-priority task is running?
Explanation: Preemptive scheduling allows the scheduler to immediately interrupt a running lower-priority task in favor of a higher-priority one. Running both simultaneously is not possible without multi-core systems or parallel execution. Waiting its turn describes non-preemptive scheduling. Lower-priority tasks do not finish before preemption in preemptive scheduling.
What is the approximate CPU utilization bound for scheduling N independent periodic tasks with rate monotonic scheduling?
Explanation: For a large number of periodic tasks under rate monotonic scheduling, the theoretical schedulable utilization bound approaches about 69%. 100% utilization cannot be guaranteed without missing deadlines. The 85% figure is for specific numbers of tasks, not all cases, and 50% is too conservative for this policy.
Which of the following is a common consequence when a real-time system task misses its deadline?
Explanation: When a deadline is missed, the system might exhibit failures or produce invalid outputs, especially in hard real-time systems. Restarting the task or having another task take over is not typical in basic real-time systems. Indefinite waiting usually leads to further missed deadlines or resource issues.
How does a periodic task differ from an aperiodic task in real-time scheduling?
Explanation: Periodic tasks are scheduled to occur at regular, predictable intervals, whereas aperiodic tasks do not have predetermined arrival times. Both types can miss deadlines if overloaded. CPU requirements and execution times can vary for both, and are not defining traits.
What impact does excessive scheduling overhead have on a real-time system?
Explanation: When the system spends too much time on scheduling decisions, less time remains for executing actual tasks, increasing the risk of missed deadlines. Higher priorities do not help if scheduling takes excessive time. Increased overhead makes meeting deadlines harder, not easier, and it does not inherently remove preemption capability.
What is a primary challenge of scheduling real-time tasks on multiple processors?
Explanation: On multiprocessor systems, synchronizing tasks with dependencies is essential to avoid timing conflicts and data inconsistency. While clock drift can be managed, it is not the main challenge. Tasks having equal periods is not a requirement, and the system's purpose is to allow multiple tasks to be processed concurrently, not serially.