RT2021 Chap5
RT2021 Chap5
Week 5:
Aperiodic real time scheduling
J1 J2 J3 J4 J5
Ci 1 1 1 3 2
di 3 10 7 8 5
d1 d5 d3 d4 d2
J1 J5 J3 J4 J2
0 1 2 3 4 5 6 7 8 9 10 t
J1 J2 J3 J4 J5
Ci 1 2 1 4 2
di 2 5 4 8 6
d1 d3 d2 d5 d4
J1 J3 J2 J5 J4
0 1 2 3 4 5 6 7 8 9 10 t
σ Jb Ja
σ’ Ja Jb
a0 fb fa ’ fb ’ = fa da db t
J1 J2 J3 J4 J5
ai 0 0 2 3 6
Ci 1 2 2 2 2
Di 2 5 4 10 9
J1
J2
J3
J4
J5
0 1 2 3 4 5 6 7 8 9 10 11 t
❑ (t):
the task executing in the time slice [t,t+1) in
❑ E(t):
the ready task with the earliest deadline at time t
❑ tE(t):
the time ( t) at which the next slice of task E(t) begins its
execution in the current schedule
J1 σ(t) = 4 , σ(tE) = 2
J2
J3
J4
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 t
t=4 tE=6
J1 σ(t) = 4 , σ(tE) = 2
J2
J3
J4
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 t
t=4 tE=6
NLT, SoICT, 2021
❑ Lmax = max(f2-d2, f4-d4)
❑ L’max = max(f’2-d2, f’4-d4)
❑ d2<d4
❑ f’2 < f2
❑ In the worst case when σ(t) are the time slice that each
task finishes
f2 = f’4
6 4 6
4 3
J1 J3 J4 J1 J2
6 5
J2 misses 6 6
deadline J1 J3
J1 J3
because
f1 = 6 > 5 = d 2
J1
NLT, SoICT, 2021
Bratley's algorithm (1|no_preem|feasible)
J1 J2 J3 J4
❑ Found a feasible schedule: ai 4 1 1 0
J4→J2→J3→J1
Ci 2 1 2 2
di 7 5 6 4
J1
J2
J3
J4
0 1 2 3 4 5 6 7
LIFO execution
➔ LDF achieves
smaller Lmax
➔ EDF is not
optimal under
precedence
constraints
𝐿𝑚𝑎𝑥(Γ) ≥ 𝑓 − 𝑑𝑘
∗
➔ 𝐿 𝑚𝑎𝑥 (Γ) ≤ 𝐿𝑚𝑎𝑥 (Γ)
NLT, SoICT, 2021
EDF with precedence constraints
❑ Scheduling problem: (1|prec, preem|Lmax)
❑ Difficulty: EDF is not optimal with precedence constraints
❑ Provided task 𝐽𝑎, 𝐽𝑏 ∈ 𝐽 that 𝐽𝑎 → 𝐽𝑏(immediate
predecessor)
➔Starting time of Jb and deadline of Ja will be modified to
replace precedence constraint
Modifying
timing Scheduling
constraints with EDF
J J’ 𝜎
➔ Modifying deadline of Ja