a) A system consists of three periodic tasks: (4, 1), (5, 2), and (8, 3).
Construct an EDF Schedule. b) Construct a RM Schedule for this system
in part (a). Compare the results.
Answer:
Given Tasks:
Each task is represented as (Period, Execution Time)
T1 = (4, 1) → Period = 4, Execution Time = 1
T2 = (5, 2) → Period = 5, Execution Time = 2
T3 = (8, 3) → Period = 8, Execution Time = 3
a) EDF (Earliest Deadline First) Scheduling
EDF is a dynamic priority scheduling algorithm, where the task with the
earliest deadline gets the highest priority.
Tim Active
Task Selected
e Tasks
T1 (Earliest deadline
0 T1, T2, T3
at 4)
T2 (Earliest deadline
1 T2, T3
at 5)
T2 (Finishes at time
2 T2, T3
3)
3 T3 T3
4 T1, T3 T1 (T1 arrives again)
5 T3 T3
6 T3 T3
7 Idle Idle
8 T1, T2, T3 T1 (New cycle begins)
b) RM (Rate Monotonic) Scheduling
RM is a static priority scheduling algorithm, where the task with the
smallest period gets the highest priority. The priorities for tasks:
T1 (Period = 4) → Highest Priority
T2 (Period = 5) → Medium Priority
T3 (Period = 8) → Lowest Priority
Tim Active Task
e Tasks Selected
0 T1, T2, T3 T1
1 T2, T3 T2
2 T2, T3 T2
3 T3 T3
4 T1, T3 T1
5 T3 T3
6 T3 T3
7 Idle Idle
8 T1, T2, T3 T1
Comparison of EDF vs RM
Comparison EDF (Earliest Deadline
RM (Rate Monotonic)
Factor First)
Dynamic (based on
Priority Fixed (based on periods)
deadlines)
CPU Utilization Higher Lower
Preemptions More frequent Less frequent
Good for soft real-time Good for hard real-time
Suitability
systems systems
EDF (Earliest Deadline First) Schedule
'X' represents execution of a task.
Task with the nearest deadline gets CPU time first.
RM (Rate Monotonic) Schedule
'X' represents execution of a task.
Tasks are scheduled based on fixed priority (shortest period first).