Real-Time Concurrency: Scheduling and Deadlines Quiz Quiz

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.

  1. Rate Monotonic Scheduling Fundamentals

    In a real-time system using rate monotonic scheduling, which tasks are given higher priorities?

    1. Tasks with longer execution times
    2. Tasks that start later
    3. Tasks with shorter periods
    4. Tasks with more I/O operations

    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.

  2. Earliest Deadline First Principle

    Under the earliest deadline first (EDF) algorithm, what determines a task’s execution priority?

    1. Its initial start time
    2. Its next closest deadline
    3. Its stack memory usage
    4. Its longest waiting time

    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.

  3. Hard vs. Soft Real-Time Systems

    Which statement accurately describes a hard real-time system?

    1. Any result is acceptable regardless of timing
    2. Tasks are executed without concern for timing
    3. A missed deadline can lead to system failure
    4. Late results cause only performance degradation

    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.

  4. Task Arrival and Response Time

    If a task arrives at time 0 and has a deadline at time 10, which of the following defines its response time?

    1. The time between two consecutive arrivals
    2. The time from arrival to task completion
    3. The delay caused by hardware interrupts
    4. The sum of all task priorities

    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.

  5. Task Preemption Concept

    In preemptive scheduling, what happens if a higher-priority task becomes ready while a lower-priority task is running?

    1. The lower-priority task is interrupted
    2. Both tasks run simultaneously
    3. The lower-priority task finishes uninterrupted
    4. The higher-priority task waits its turn

    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.

  6. Schedulable Utilization Bound

    What is the approximate CPU utilization bound for scheduling N independent periodic tasks with rate monotonic scheduling?

    1. Exactly 100% always
    2. About 69% for large N
    3. Equal to 50% regardless of N
    4. Approximately 85% for all cases

    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.

  7. Deadline Miss Handling

    Which of the following is a common consequence when a real-time system task misses its deadline?

    1. Task immediately restarts from the beginning
    2. Task waits indefinitely for CPU allocation
    3. System may produce incorrect outputs or fail
    4. Another task takes over its execution

    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.

  8. Periodic, Aperiodic, and Sporadic Tasks

    How does a periodic task differ from an aperiodic task in real-time scheduling?

    1. Periodic tasks always require more CPU time
    2. Aperiodic tasks have constant execution times
    3. Periodic tasks can never miss deadlines, aperiodic can
    4. Periodic tasks arrive at fixed intervals, while aperiodic tasks arrive unpredictably

    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.

  9. Scheduling Overhead Influence

    What impact does excessive scheduling overhead have on a real-time system?

    1. It reduces available CPU time for actual tasks
    2. It makes all deadlines easier to meet
    3. It eliminates task preemption
    4. It increases overall task priorities

    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.

  10. Multiprocessor Scheduling Challenge

    What is a primary challenge of scheduling real-time tasks on multiple processors?

    1. Processor clocks always running at different speeds
    2. Ensuring tasks with dependencies are properly synchronized
    3. Tasks can only execute one at a time
    4. All tasks must have equal periods

    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.