HW3R
HW3R
Given that:
τ1={e1=3,p1=7}
τ2={e2=5,p2=16}
τ3={e3=3,p3=15}
Where:
ei: Execution time of task τi
pi: Period of task τi
Lets calculate the individual utilization:
ei
U i=
pi
For τ1:
3
U 1= ≈ 0.4286
7
For τ2:
5
U 2= ≈ 0.3125
16
For τ3:
3
U 3= ≈ 0.2
15
Now we will calculate the total utilization:
U =U 1+ U 2 +U 3
U =0.4286+0.3125+ 0.2=0.9411
For n=3 tasks, the RMS utilization bound is:
1
U RMS =3 ×(2 3 −1)≈ 0.779
Since U=0.9411>0.779, the task set does not satisfy the RMS utilization bound, meaning we cannot
guarantee schedulability solely based on this criterion.
To determine if the task set is schedulable under RMS, we will construct the schedule up to the least
common multiple (LCM) of the task periods.
Calculate hyper period:
LCM (7 ,16 ,15)=336
For simplicity, let’s construct the schedule from t=0 to t=50 and verify if tasks miss any deadlines.
According to RMS:
Based on the constructed schedule, all tasks meet their deadlines up to t=50. However, since the total
utilization is higher than the RMS bound, further testing beyond this interval would be required to
confirm schedulability over the hyperperiod. Nonetheless, this initial scheduling suggests the task set
may be schedulable with RMS, despite exceeding the RMS utilization bound.
Question 2:
Solution:
To verify the schedulability of the given task set under the Earliest Deadline First (EDF) algorithm,
we need to calculate the utilization and check if it satisfies the EDF schedulability condition.
For EDF, a task set is schedulable if the total utilization 𝑈 of all tasks is less than or equal to 1:
n
ei
U =∑ ≤1
i=1 pi
LCM (5 ,8 , 4)=40
Thus, we’ll construct the schedule over a time span of 40 units.
Question 3:
Context-switching overhead refers to the time required by the CPU to switch from executing one
task to another. During a context switch, the operating system (OS) saves the state of the currently
running task and loads the state of the next task to be executed. This involves saving and restoring
CPU registers, program counters, and stack pointers, as well as updating other scheduling-related
data.
Context-switching overhead affects real-time systems because it consumes CPU time that could
otherwise be spent executing tasks, potentially impacting schedulability and system performance. In
real-time scheduling, failing to account for context-switching overhead could lead to missed
deadlines, especially in systems with high task-switching frequency or high overhead costs per switch.
In Rate-Monotonic Scheduling (RMS), tasks are assigned priorities based on their periods (shorter
periods get higher priorities). The schedulability of a task set is typically checked by calculating the
utilization bound.
For 𝑛 tasks in RMS, the utilization bound 𝑈 (without context-switching overhead) is:
1
n
U RMS ≤ n ×(2 −1)