Professional Documents
Culture Documents
Updated 2009-02-24
Real-
Real-Time Systems Deadline-
Deadline-monotonic scheduling
Properties:
• Uses static priorities
Specification – Priority is determined by urgency: the task with the shortest
relative deadline receives highest priority
– Proposed as a generalization of rate-monotonic scheduling
• Dynamic scheduling
(J. Leung and J. W. Whitehead, 1982)
Implementation -- Deadline-monotonic
scheduling Note that RM is a special case of DM, with Di = Ti
• Response-time analysis
• Theoretically well-established
– Exact feasibility test exists (an NP-complete problem)
Verification – DM is optimal among all scheduling algorithms that use static
task priorities for which Di ≤ Ti
(shown by J. Leung and J. W. Whitehead in 1982)
Response-
Response-time analysis Response-
Response-time analysis
0 5 10 t
1
EDA222/DIT160 – Real-Time Systems, Chalmers/GU, 2008/2009 Lecture #13
Updated 2009-02-24
Response-
Response-time analysis Response-
Response-time analysis
Interference: Interference:
Consider two tasks, τ i and τ j , where τ j has higher priority Task τ i can be preempted by higher-
higher-priority task τ j.
The response time för τ i is at most Ri time units.
Case 2: T j < Ri ≤ 2T j ⇒ Ri = Ci + 2C j
If 0 < Ri ≤ T j , task τ i can be preempted at most one time by τ j
Ri
Ci , 1 Ci , 2 If T j < Ri ≤ 2T j , task τ i can be preempted at most two times by τ j
If 2T j < Ri ≤ 3T j , task τ i can be preempted at most three times by τ j
τi
Tj ...
⎡ Ri ⎤
Cj The number of interferences from τ j is limited by: ⎢ ⎥
τj ⎢Tj ⎥
⎡ Ri ⎤
The total time for these interferences are: ⎢ ⎥Cj
0 5 10 t ⎢Tj ⎥
Response-
Response-time analysis Response-
Response-time analysis
Interference: Interference:
• For static-priority scheduling, the interference term is • The equation does not have a simple analytic solution.
⎡R ⎤ • However, an iterative procedure can be used:
Ii = ∑ ⎢ i ⎥ C j
∀j∈hp ( i ) ⎢ T j ⎥ ⎡ Rin ⎤
where hp (i ) is the set of tasks with higher priority than τ i .
Rin +1 = Ci + ∑ ⎢ ⎥Cj
∀j∈hp ( i ) ⎢ T j ⎥
• The response time for a task τ i is thus:
• The iteration starts with a value that is guaranteed to be
less than or equal to the final value of Ri (e.g. Ri = Ci )
0
⎡R ⎤
Ri = Ci + ∑ ⎢ i ⎥ C j • The iteration completes at convergence ( Rin +1 = Rin) or if
∀j∈hp (i ) ⎢ T j ⎥ the response time exceeds some threshold (e.g. Di )
2
EDA222/DIT160 – Real-Time Systems, Chalmers/GU, 2008/2009 Lecture #13
Updated 2009-02-24
The response-
response-time analysis and associated feasibility test
was presented by M. Joseph and P. Pandya in 1986.
Problem: Assume a system with tasks according to the figure The test can be extended to handle:
below. The timing properties of the tasks are given in the table.
a) Calculate the task response times. • Blocking
b) Show that the tasks are schedulable using DM • Start-time variations (”release jitter”)
c) What is the outcome of Liu & Layland’s feasibility test for RM?
• Time offsets
• Deadlines exceeding the period
Task Ci Di Ti
τ1 τ2 τ3 τ1 12 52 52 • Overhead due to context switches, timers, interrupts, …
τ2 10 40 40
τ3 10 30 30
In this course, we only study blocking.
3
EDA222/DIT160 – Real-Time Systems, Chalmers/GU, 2008/2009 Lecture #13
Updated 2009-02-24
Extended response-
response-time analysis Extended response-
response-time analysis
Blocking can be accounted for in the following cases: Blocking using ceiling priority protocol ICPP:
• Blocking caused by critical regions priority (H) > priority (M) > priority (L)
normal execution H and L share resource R
– Blocking factor Bi represents the length of critical region(s) that
are executed by processes with lower priority than τ i critical region
• Blocking caused by non-preemptive scheduling H blocked
L receives R’s ceiling priority (= H’s priority)
– Blocking factor Bi represents largest WCET (not counting τ i ) L receives original priority
H
t
⎡R ⎤
Ri = Ci + Bi +∑ ⎢ i ⎥ C j
∀j∈hp ( i ) ⎢ T j ⎥ M
t
Extended response-
response-time analysis Extended response-
response-time analysis
4
EDA222/DIT160 – Real-Time Systems, Chalmers/GU, 2008/2009 Lecture #13
Updated 2009-02-24
Problem: Assume a system with tasks according to the figure below. Problem: (cont’
(cont’d)
The timing properties of the tasks are given in the table.
Examine the schedulability of the tasks when ICPP (Immediate
Two semaphores S1 and S2 are used for synchronizing the tasks.
Ceiling Priority Protocol) is used.
The parameters HS1 and HS2 represent the longest time a task may
a) Derive the ceiling priorities of the semaphores.
lock semaphore S1 and S2, respectively.
b) Derive the blocking factors for the tasks.
c) Show whether the tasks are schedulable or not.
τ1 τ2 τ3 Task Ci Di Ti HS1 HS2
τ1 2 4 5 1 1
τ2 3 12 12 1 -
We solve this on the whiteboard!
S1 S2 τ3 8 24 25 - 2