Aperiodic Task Scheduling
Aperiodic Task Scheduling
com
1 processor
arbitrary arrival times of tasks
preemption
performance measure: maximum lateness
no resources, no precedence constraints
www.getmyuni.com
Example
EDF
At any instant execute the task with the earliest absolute
deadline among all the ready tasks.
www.getmyuni.com
Earliest Deadline First
Optimality of EDF
Theorem (Horn)
Given a set of n independent tasks with arbitrary arrival times,
the EDF algorithm is optimal with respect to minimazing the
maximum lateness.
www.getmyuni.com
Earliest Deadline First
Guarantee Test
∀i : Σik=1Ck ≤ di
asynchronous activation: “dynamical version” of the
previous test
www.getmyuni.com
Earliest Deadline First
EDF:
is optimal
works on-line
easy to implement
simple guarantee test
www.getmyuni.com
Earliest Deadline First
J1 J2 J3
ai 0 0 0
2 Processors
Ci 1 1 5
di 1 2 5
LST
At any instant execute the task with the least slack time (that
is di − Ci ) among all the ready tasks.
Example
Find a set of task such that EDF and LST produce different
schedules.
www.getmyuni.com
Non-preemptive Scheduling: The Problem
1 processor
arbitrary arrival times of tasks
preemption not allowed
performance measure: maximum lateness
no resources, no precedence constraints
EDF www.getmyuni.com
Non-optimality of EDF
Find a set of task such that EDF does not produce optimal
schedule.
EDF www.getmyuni.com
Non-optimality of EDF
EDF www.getmyuni.com
EDF and Non-idle Schedules
Optimal Scheduling
Search Tree
www.getmyuni.com
Brute Force
Pruning
Pruning: Example
www.getmyuni.com
Brute Force
Example
J1 J2 J3 J4
ai 0 4 2 6
Ci 6 2 4 2
di 18 8 9 10
generally NP-complete
we consider two special cases, polynomial algorithms
remark on heuristical approach
www.getmyuni.com
Latest Deadline First
1 processor
precedence constraints
synchronous activation (∀i : ai = 0)
(preemption does not matter)
performance measure: maximum lateness
www.getmyuni.com
Latest Deadline First
Example
LDF
among tasks without successors select the task with the
latest deadline
remove this task from the precedence graph and put it
into a stack
repeat until all tasks are in the stack
the stack represents the order in which tasks should be
scheduled
LDF is optimal.
www.getmyuni.com
Latest Deadline First
LDF: example
www.getmyuni.com
Modified EDF
1 processor
precedence constraints
arbitrary arrival times of tasks
preemption
performance measure: maximum lateness
www.getmyuni.com
Modified EDF
Example
Precedence constraints:
A → C ; A → D; B → D, B → E ; E → D; C → F ; D → F
A B C D E F
a 0 2 5 4 1 2
C 3 2 2 3 1 3
d 8 8 13 10 5 14
www.getmyuni.com
Modified EDF
Basic Idea
If JY → JX then:
s X ≥ aX
JX cannot start earlier than its activation time
sX ≥ aY + CY
JX cannot start earliear than the minimum finishing time
of JY
www.getmyuni.com
Modified EDF
aX ∗ = max(aX , max(aY + CY , JY → JX ))
Modification of Deadlines
If JX → JY then:
fX ≤ dX
JX must finish within its deadline
fX ≤ dY − CY
JX must finish not later than the maximum starting time
of JY
www.getmyuni.com
Modified EDF
new deadline:
dX ∗ = min(dX , min(dY − CY , JX → JY ))
modified deadline times must be computed in the correct order
(given by precedence constraints)
www.getmyuni.com
Modified EDF
Optimality
Theorem
There exists feasible schedule for the modified task set J∗
under EDF if and only if the original task set is schedulable.
www.getmyuni.com
Modified EDF
Example
Precedence constraints:
A → C ; A → D; B → D, B → E ; E → D; C → F ; D → F
A B C D E F
a 0 2 5 4 1 2
C 3 2 2 3 1 3
d 8 8 13 10 5 14
a∗ 0 2 5 5 4 8
d∗ 7 4 11 10 5 14
www.getmyuni.com
Modified EDF
Example
precedence constraints: A → C , B → C , C → E , D →
F , B → D, C → F , D → G
all tasks: ai = 0, Di = 25, computation times: 2, 3, 3, 5,
1, 2, 5
compute modified arrival times and deadlines
compute schedule according to EDF
www.getmyuni.com
Heuristical algorithms
Heuristical search
Heuristical search
Heuristic function