📝 Rate Monotonic Scheduling in Real Time CPU Scheduling (48 MCQs)
📖 From Operating System • 6. CPU Scheduling • 48 questions available
What is Rate Monotonic Scheduling in Real Time CPU Scheduling?
Definition:
RMS is an optimal static-priority algorithm for periodic tasks where priority is inversely proportional to period , guaranteed schedulable if .
Example:
Three tasks with (C=2,T=10), (C=3,T=15), (C=4,T=20) have utilization 0.2+0.2+0.2=0.6 < 0.78, so RMS guarantees all deadlines are met.
Reason:
RMS provides the highest possible schedulability bound among fixed-priority algorithms, making it the standard for certifiable real-time systems despite being suboptimal compared to EDF.
📝 All Rate Monotonic Scheduling in Real Time CPU Scheduling MCQs
Q1. What type of scheduling policy does rate-monotonic scheduling use?
📖 Explanation: Rate-monotonic scheduling is a static priority algorithm. This means priorities are fixed and assigned when the task enters the system. It also uses preemption, so a higher-priority task can interrupt a lower-priority one to ensure timely execution.
Q2. In rate-monotonic scheduling, how is priority assigned to a periodic task?
📖 Explanation: The core rule of RMS is that tasks with shorter periods get higher priorities. This is because they require the CPU more frequently. Conversely, tasks with longer periods receive lower priorities, as they are less demanding in terms of frequency.
Q3. What assumption does rate-monotonic scheduling make about a periodic process's CPU burst?
📖 Explanation: RMS assumes that each periodic task has a fixed and constant processing time for every CPU burst. This deterministic behavior is a key characteristic that allows the scheduler to perform its feasibility analysis and guarantee deadlines.
Q4. According to rate-monotonic scheduling, which of the following tasks would be assigned the highest priority?
📖 Explanation: The task with the shortest period (20ms) would get the highest priority. The rule is inverse: the shorter the period, the higher the priority. This task needs the CPU most often, so it is given precedence over tasks with longer periods.
Q5. What is the priority assignment for a task with a period of 80ms compared to a task with a period of 50ms?
📖 Explanation: Since the period of 50ms is shorter than 80ms, the task with the 50ms period will be assigned a higher priority. This is the fundamental principle of rate-monotonic scheduling: shorter periods lead to higher priorities.
Q6. What is the CPU utilization of a process if its burst time is 20 and its period is 50?
📖 Explanation: CPU utilization for a periodic task is calculated as the ratio of its burst time to its period (t/p). In this case, 20/50 = 0.40, or 40%. This represents the fraction of CPU time the task requires to meet its deadlines.
Q7. What is the total CPU utilization if task P1 has t1=20, p1=50 and task P2 has t2=35, p2=100?
📖 Explanation: The total CPU utilization is the sum of individual utilizations. P1: 20/50 = 0.40. P2: 35/100 = 0.35. The total is 0.40 + 0.35 = 0.75, or 75%. This is a key metric for determining schedulability.
Q8. What is the worst-case CPU utilization bound for scheduling N processes using rate-monotonic scheduling?
📖 Explanation: The worst-case CPU utilization bound for RMS is given by the formula . This bound decreases as N increases, approaching approximately 69% as N approaches infinity. It defines the maximum total utilization that can be guaranteed.
Q9. What is the CPU utilization bound for rate-monotonic scheduling with two processes?
📖 Explanation: For N=2, the CPU utilization bound is , which is approximately 0.828 or 83%. This means that if the total utilization of two tasks is less than or equal to 83%, RMS can guarantee their schedulability.
Q10. If the total CPU utilization of two tasks is 75%, what can be concluded about their schedulability under RMS?
📖 Explanation: Since 75% is less than the RMS bound of ~83% for two tasks, the tasks are guaranteed to be schedulable by the rate-monotonic algorithm. The utilization bound provides a sufficient condition for schedulability under RMS.
Q11. Why is rate-monotonic scheduling considered optimal?
📖 Explanation: RMS is considered optimal in the sense that it is the best static priority scheduling algorithm. If RMS fails to schedule a task set, then no other static priority algorithm can schedule it either. This optimality is a key theoretical property of the algorithm.
Q12. A task set has a total CPU utilization of 94%. What does this imply for rate-monotonic scheduling?
📖 Explanation: A utilization of 94% exceeds the RMS bound of ~83% for two tasks. This means RMS cannot provide a guarantee. While the tasks might still be schedulable in some cases, the algorithm's guarantee is lost, and a feasibility test or other analysis would be required to confirm schedulability.
Q13. In the example with P1(p=50, t=20) and P2(p=100, t=35), what happens if P2 is given higher priority than P1?
📖 Explanation: If P2 is given higher priority, it runs first and completes at time 35. P1 then runs from 35 to 55. Since P1's first deadline is at time 50, it misses its deadline. This demonstrates why the rate-monotonic priority assignment (P1 higher) is critical for schedulability.
Q14. In the schedulable example with P1(p=50, t=20) and P2(p=100, t=35), at what time does P1 complete its first CPU burst under RMS?
📖 Explanation: Under RMS, P1 has higher priority and runs first. It requires 20ms of CPU time and starts at time 0. Therefore, it completes its first burst at time 20, successfully meeting its first deadline of 50.
Q15. In the schedulable example with P1(p=50, t=20) and P2(p=100, t=35), at what time does P2 complete its first CPU burst under RMS?
📖 Explanation: P2 runs after P1 from time 20 to 50, but is preempted by P1 at time 50. P1 runs from 50 to 70, then P2 resumes. P2 has 35ms total burst; it used 30ms (20-50), so has 5ms remaining. It runs from 70 to 75, completing its burst at time 75.
Q16. A system has three periodic tasks with periods 10ms, 20ms, and 30ms. What are their relative priorities under RMS from highest to lowest?
📖 Explanation: Under RMS, priority is inversely proportional to period. The shortest period (10ms) gets the highest priority, followed by 20ms, and the longest period (30ms) gets the lowest priority. Thus, the order is 10ms > 20ms > 30ms.
Q17. What is the rational behind assigning higher priority to tasks with shorter periods in RMS?
📖 Explanation: The rationale is that tasks with shorter periods have higher frequency requirements. They need to be executed more often. Giving them higher priority ensures they meet their more frequent deadlines, which is critical for their successful execution.
Q18. What is the CPU utilization bound for rate-monotonic scheduling as the number of processes approaches infinity?
📖 Explanation: The formula approaches approximately 69% (specifically, the natural log of 2, which is about 0.693) as N goes to infinity. This means for a large number of tasks, RMS can only guarantee schedulability if total utilization is about 69% or less.
Q19. In the non-schedulable example with P1(p=50, t=25) and P2(p=80, t=35), why does P2 miss its deadline?
📖 Explanation: P2 misses its deadline because the total utilization (94%) exceeds the RMS bound of ~83%. This means RMS cannot guarantee schedulability. In the execution, P2 is preempted at time 50 and doesn't get enough time to complete its burst before its deadline at time 80.
Q20. What is the significance of the CPU utilization bound in rate-monotonic scheduling?
📖 Explanation: The CPU utilization bound is a key theoretical result. If the total utilization of a set of tasks is less than or equal to this bound, then RMS guarantees they will be scheduled to meet all their deadlines. It provides a sufficient condition for schedulability.
Q21. A set of 4 tasks has a total CPU utilization of 70%. According to the RMS bound, are they guaranteed to be schedulable?
📖 Explanation: For N=4, the RMS bound is , which is approximately 0.756 or 75.6%. Since 70% is less than 75.6%, the tasks are guaranteed to be schedulable under RMS. This demonstrates the use of the bound as a schedulability test.
Q22. What happens when a higher-priority process becomes available in rate-monotonic scheduling?
📖 Explanation: RMS uses preemption. This means if a higher-priority task becomes ready, it will immediately preempt the currently running lower-priority task. The CPU is then allocated to the higher-priority task, ensuring its more frequent requirements are met.
Q23. What is the total CPU utilization in the schedulable example with P1(p=50, t=20) and P2(p=100, t=35)?
📖 Explanation: The utilization is calculated as (t1/p1) + (t2/p2) = (20/50) + (35/100) = 0.40 + 0.35 = 0.75, or 75%. This is below the RMS bound of 83% for N=2, which is why the tasks can be guaranteed schedulable.
Q24. In the non-schedulable example with P1(p=50, t=25) and P2(p=80, t=35), why is RMS unable to guarantee schedulability?
📖 Explanation: The total utilization of 94% exceeds the worst-case CPU utilization bound for RMS with two tasks, which is approximately 83%. This means that while the tasks might be schedulable in some scenarios, RMS cannot provide a guarantee, and the example shows a case where it fails.
Q25. What is the worst-case CPU utilization bound for rate-monotonic scheduling with one process?
📖 Explanation: With one process, there is no preemption or contention for the CPU. The process can use 100% of the CPU if needed, as it is the only task. The formula for N=1 yields 100%.
Q26. What is the key difference between the schedulable and non-schedulable examples of RMS provided?
📖 Explanation: The key difference is the total utilization. The schedulable example has 75% utilization, which is below the RMS bound. The non-schedulable example has 94% utilization, which exceeds the bound. This demonstrates how the utilization bound determines whether RMS can provide a guarantee.
Q27. Which of the following is a limitation of rate-monotonic scheduling?
📖 Explanation: RMS is optimal among static priority algorithms, but it is not universally optimal. Its main limitation is the CPU utilization bound. For a set of tasks with total utilization above this bound, RMS cannot guarantee schedulability, as demonstrated in the non-schedulable example.
Q28. In the schedulable RMS example, at what time is the system idle until the next period of P1?
📖 Explanation: After P2 completes its first burst at time 75, the system has no pending tasks. The next event is at time 100, when the next period of P1 begins. From time 75 to 100, the CPU is idle, indicating the system has spare capacity.
Q29. What is the priority of a task with period 80ms compared to a task with period 50ms in RMS?
📖 Explanation: In RMS, priority is inversely proportional to period. Since 50ms is shorter than 80ms, the task with the 50ms period has the higher priority. This is a direct application of the fundamental RMS priority assignment rule.
Q30. What does the CPU utilization of a process represent?
📖 Explanation: CPU utilization of a periodic process is defined as the ratio of its burst time (t) to its period (p). It represents the fraction of the CPU's total capacity that the process requires to complete its work on time.
Q31. In the non-schedulable RMS example, at what time does P2 miss its deadline?
📖 Explanation: P2's period is 80ms, so its first deadline is at time 80. In the example, P2 is preempted by P1 at time 50, and P1 runs until time 75. P2 then runs from 75 to 80 but only has 5ms of the remaining 10ms to run. It does not complete by time 80, thus missing its deadline.
Q32. What is the scheduling behavior when a process has a CPU burst that is equal to its period?
📖 Explanation: If a process's burst time (t) equals its period (p), its utilization is 1.0 (100%). This means the CPU is fully dedicated to this process, and no other process can be scheduled with it. Even a single such process would leave no room for any other task.
Q33. If a set of tasks has a total utilization of 80% with N=3, are they guaranteed schedulable by RMS?
📖 Explanation: For N=3, the RMS bound is , which is approximately 0.779 or 77.9%. Since 80% exceeds this bound, RMS cannot provide a guarantee. The tasks might still be schedulable, but a different schedulability test would be needed.
Q34. What is the primary characteristic of static priority scheduling used in RMS?
📖 Explanation: Static priority means the priority of a task is fixed when it enters the system and does not change over time. In RMS, this priority is determined solely by the task's period and remains constant throughout its execution.
Q35. What happens to the CPU utilization bound as the number of processes (N) increases in RMS?
📖 Explanation: The CPU utilization bound decreases as N increases. It starts at 100% for N=1 and asymptotically approaches approximately 69% as N approaches infinity. This means it becomes more difficult to guarantee schedulability as the number of tasks grows.
Q36. In the schedulable RMS example, why is P2 preempted at time 50?
📖 Explanation: P2 is preempted at time 50 because the next period of P1 starts. Since P1 has a shorter period (50ms) than P2 (100ms), it has a higher priority under RMS. The arrival of P1's new job at time 50 triggers a preemption of the lower-priority P2.
Q37. What is the CPU utilization of process P1 in the non-schedulable example (p1=50, t1=25)?
📖 Explanation: The CPU utilization of P1 is the ratio of its burst to its period: t1/p1 = 25/50 = 0.50 or 50%. This high individual utilization is a contributing factor to the total utilization exceeding the RMS bound.
Q38. What is the CPU utilization of process P2 in the non-schedulable example (p2=80, t2=35)?
📖 Explanation: The CPU utilization of P2 is calculated as 35/80 = 0.4375, or 43.75%. Combined with P1's 50% utilization, this gives a total of 93.75% (approximately 94%), which exceeds the RMS bound for two tasks.
Q39. What does the term 'rate' in rate-monotonic scheduling refer to?
📖 Explanation: The 'rate' in rate-monotonic scheduling refers to the frequency of a periodic task, which is the inverse of its period (1/p). A higher rate (shorter period) gets a higher priority. This is the core concept behind the name of the algorithm.
Q40. What is the key characteristic of a periodic task that allows rate-monotonic scheduling to work effectively?
📖 Explanation: RMS relies on the predictability of periodic tasks. The fact that a task's period (p) and processing time (t) are known and fixed allows the scheduler to assign fixed priorities and perform schedulability analysis. This predictability is essential for the algorithm's guarantees.
Q41. In the schedulable example, how much CPU time is P2 able to execute before its first preemption?
📖 Explanation: P2 starts at time 20 and runs until it is preempted at time 50. This gives it 30ms of execution time. It needs 35ms total, so it still has 5ms remaining when it is preempted. This demonstrates how RMS ensures higher-priority tasks are not starved.
Q42. What is the total CPU utilization in the non-schedulable example with P1(p=50, t=25) and P2(p=80, t=35)?
📖 Explanation: The total utilization is (25/50) + (35/80) = 0.50 + 0.4375 = 0.9375, which is approximately 94%. This high utilization is the reason RMS cannot guarantee schedulability, as it exceeds the approximately 83% bound for N=2.
Q43. What is the implication of the RMS utilization bound?
📖 Explanation: The bound provides a sufficient condition: if total utilization is ≤ the bound, tasks are guaranteed schedulable. It does not provide a necessary condition; tasks might still be schedulable if their total utilization exceeds the bound. It is a tool for guaranteeing schedulability, not a universal limit.
Q44. In the non-schedulable example, what is the state of P2 at time 50?
📖 Explanation: At time 50, P2 has run from time 25 to 50, which is 25ms. Its total burst is 35ms, so it has 10ms remaining. It is preempted by P1 at time 50 and does not get to run again until time 75, which leads to it missing its deadline at time 80.
Q45. What is the priority order for tasks in the schedulable example under RMS?
📖 Explanation: In the schedulable example, P1 has a period of 50ms and P2 has a period of 100ms. Since P1 has the shorter period, it is assigned a higher priority under RMS. This is why P1 preempts P2 at time 50.
Q46. What is the relationship between a task's rate and its priority in RMS?
📖 Explanation: The 'rate' of a task is 1/p. A task with a higher rate has a shorter period and therefore requires the CPU more frequently. RMS assigns higher priority to tasks with higher rates. This is the fundamental rule of the algorithm.
Q47. What does the RMS bound of approximately 69% represent?
📖 Explanation: The bound of approximately 69% (specifically, ln 2) is the limit of the formula as N approaches infinity. It represents the worst-case CPU utilization for which RMS can guarantee schedulability when there are a very large number of tasks.
Q48. Why is rate-monotonic scheduling considered a static priority algorithm?
📖 Explanation: It is static because the priority of each task is assigned once and remains constant for the duration of its execution. This contrasts with dynamic priority algorithms, where priorities can change based on system conditions, such as deadlines or execution history.