Real Time Scheduling Algorithm
Real Time Scheduling Algorithm
Outline
Real-time systems
Real-time scheduling algorithms
Fixed-priority algorithm (RM)
Dynamic-priority algorithm (EDF)
Real-Time Workload
Job (unit of work)
a computation, a file read, a message transmission, etc
Attributes
Resources required to make progress
Timing parameters
Released
Execution time
Absolute
deadline
Relative deadline
Real-Time Task
Task : a sequence of similar jobs
Periodic task (p,e)
10
15
Schedulability
Property indicating whether a real-time system (a set
of real-time tasks) can meet their deadlines
(4,1)
(5,2)
(7,2)
5
Real-Time Scheduling
Determines the order of real-time task executions
Static-priority scheduling
Dynamic-priority scheduling
(4,1)
(5,2)
(7,2)
10
15
10
15
6
RM (Rate Monotonic)
T1 (4,1)
T2 (5,2)
T3 (7,2)
10
15
10
15
7
RM (Rate Monotonic)
Executes a job with the shortest period
T1 (4,1)
T2 (5,2)
T3 (7,2)
10
15
10
15
8
RM (Rate Monotonic)
Executes a job with the shortest period
Deadline Miss !
T1 (4,1)
T2 (5,2)
T3 (7,2)
10
15
10
15
9
Response Time
Response time
Duration from released time to finish time
T1 (4,1)
T2 (5,2)
T3 (10,2)
10
15
10
15
10
Response Time
Response time
Duration from released time to finish time
Response Time
T1 (4,1)
T2 (5,2)
T3 (10,2)
10
15
10
15
11
Response Time
Response Time (ri) [Audsley et al., 1993]
ri
ri ei
ek
TkHP (Ti ) pk
T1 (4,1)
T2 (5,2)
T3 (10,2)
10
10
12
RM - Schedulability Analysis
Real-time system is schedulable under RM
if and only if ri pi for all task Ti(pi,ei)
13
RM Utilization Bound
Real-time system is schedulable under RM if
Ui n (21/n-1)
Liu & Layland,
Scheduling algorithms for multi-programming in a
hard-real-time environment, Journal of ACM, 1973.
14
RM Utilization Bound
Real-time system is schedulable under RM if
Ui n (21/n-1)
Example: T1(4,1), T2(5,1), T3(10,1),
Ui = 1/4 + 1/5 + 1/10
= 0.55
3 (21/3-1) 0.78
Thus, {T1, T2, T3} is schedulable under RM.
15
RM Utilization Bound
Real-time system is schedulable under RM if
Ui n (21/n-1)
16
T1 (4,1)
T2 (5,2)
T3 (7,2)
10
15
10
15
17
T1 (4,1)
T2 (5,2)
T3 (7,2)
10
15
10
15
18
T1 (4,1)
T2 (5,2)
T3 (7,2)
10
15
10
15
19
T1 (4,1)
T2 (5,2)
T3 (7,2)
10
15
10
15
20
T1 (4,1)
T2 (5,2)
T3 (7,2)
10
15
10
15
21
t
T1 (4,1)
T2 (5,2)
T3 (7,2)
10
15
10
15
22
23
RM vs. EDF
Rate Monotonic
EDF
24