Task 2: Latest Deadline First
Given the precedence graph in Figure 2 and the following table of task execution times and deadlines,
determine a Latest Deadline First (LDF) schedule. Is this schedule feasible?
J1 J2 J3 J4 J5 J6 J7 J8
Ci 3 4 2 3 3 2 2 1
Di 5 8 11 15 12 18 19 20
J5
J1 J2 J4 J6 J7
J3 J8
Figure 2: Precedence graph.
Solution for Task 2:
LDF (Latest Deadline First) is a scheduling algorithm that minimizes the maximum lateness. It assumes
synchronous task activations and is non-preemptive.
The algorithm to produce an LDF schedule proceeds in two stages: firstly, a precedence graph is con-
structed. Going from tail to head: among the tasks without successors or whose successors have been
all selected, LDF selects the tasks with the latest deadline to be scheduled last. At runtime, tasks are
extracted from the head of the queue: the first task inserted in the queue will be executed last.
The queue of tasks scheduled with LDF is as follows: J1 − J2 − J3 − J5 − J4 − J6 − J7 − J8 . The LDF
schedule is presented in Figure 3. On Figure 4 you can find a sketch of how the LDF algorithm proceeds.
Figure 3: LDF schedule.
2
J5
J5
J1 J2 J4 J6 J8
J1 J2 J4 J6 J8
J3 J7
J3 J7
J5
J5
J1 J2 J4 J6 J8
J1 J2 J4 J6 J8
J3 J7
J3 J7
J5 J5
J1 J2 J4 J6 J8 J1 J2 J4 J6 J8
J3 J7 J3 J7
J5
J1 J2 J4 J6 J8
J3 J7
Figure 4: The LDF algorithm proceeds as depicted (figures left to right)