Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Rate-monotonic scheduling
Rate Monotonic Scheduling (RMS) is a fixed-priority preemptive scheduling algorithm used in real-time operating systems. It assigns higher priorities to tasks with shorter periods, making it optimal for meeting deadlines when tasks have periods equal to their deadlines.
How Rate Monotonic Scheduling Works
The algorithm follows a simple rule: tasks with shorter periods receive higher priorities. These priorities remain fixed throughout execution, making RMS a static priority scheduling algorithm. When a higher-priority task becomes ready, it preempts any currently running lower-priority task.
Key Properties
Static priority assignment Priorities are determined before execution and remain unchanged.
Preemptive scheduling Higher priority tasks can interrupt lower priority tasks.
Independent tasks Tasks do not share resources or have dependencies.
Periodic execution Each task has a fixed period and deadline equal to its period.
Schedulability Analysis
For a set of n tasks to be schedulable under RMS, the total CPU utilization must satisfy:
U = ?(Ci/Ti) ? n(2^(1/n) - 1)
Where:
Ci Computation time of task i
Ti Period of task i
n Number of tasks
U Total CPU utilization
As n approaches infinity, the bound approaches approximately 69.3%. This means RMS can guarantee schedulability when CPU utilization stays below 70%.
Example
Consider three tasks with their computation times and periods:
| Task | Computation Time (Ci) | Period (Ti) | Priority |
|---|---|---|---|
| T1 | 2 | 5 | Highest |
| T2 | 1 | 7 | Medium |
| T3 | 2 | 10 | Lowest |
Step 1: Calculate total utilization
U = 2/5 + 1/7 + 2/10 = 0.4 + 0.143 + 0.2 = 0.743
Step 2: Calculate RMS bound for n=3 tasks
U_bound = 3(2^(1/3) - 1) = 3(1.26 - 1) = 0.78
Result: Since 0.743 < 0.78, the task set is schedulable under RMS.
Advantages and Disadvantages
| Advantages | Disadvantages |
|---|---|
| Simple to implement | Low CPU utilization (<70%) |
| Optimal for fixed priorities | Requires independent tasks |
| Predictable behavior | Not optimal when deadlines ? periods |
| Well-established theory | May cause longer waiting times |
Conclusion
Rate Monotonic Scheduling is optimal among all fixed-priority algorithms for independent periodic tasks with deadlines equal to periods. While it guarantees schedulability up to 70% CPU utilization, its simplicity and predictable behavior make it widely used in real-time systems despite the utilization limitation.
