Presentation is loading. Please wait.

Presentation is loading. Please wait.

Aperiodic Task Scheduling

Similar presentations


Presentation on theme: "Aperiodic Task Scheduling"— Presentation transcript:

1 Aperiodic Task Scheduling
張軒彬助理教授 中興大學資訊科學系 In this chapter, we present a variety of scheduling algorithms for aperiodic tasks.

2 Jackson’s Algorithm Task model: Aperiodic tasks
Synchronous release time But can have different computation time and deadlines Preemption is not an issue since all tasks arrive at the same time First, we introduce the Jackson’s algorithm. The task model assumed in Jackson’s algorithm is: tasks are aperiodic, all tasks have the synchronous release time. That is, all tasks arrive at the same time Each task may have different computation time and deadlines Since all tasks arrive at the same time, preemption is not an issue in Jackson’s algorithm.

3 Jackson’s Algorithm (Cont.)
Earliest Due Date (EDD) algorithm proposed by Jackson in 1955 Given a set of n independent tasks, any algorithm that executes the tasks in order of nondecreasing deadlines is optimal with respect to minimizing the maximum lateness Maximum lateness = maxi (fi-di) Schedulability condition (C denotes the execution time) Jackson proposed a EDD (Earliest Due Date) algorithm in 1995 that minimizes the maximum lateness of above given task model. EDD says that, given a set of n independent tasks, any algorithm that executes the tasks in order of nondecreasing deadlines is optimal respect to minimizing the maximum lateness. The definition of maximum lateness is the maximum value among n task’s finish time minus its deadline. If a task set consists of n tasks, the schedulability condition can be perfomed by verifying the following n conditions.

4 Example J1 J2 J3 J4 J5 Ci 1 3 2 di 10 7 8 5 Ci: execution time of ith-job; di: ith-job’s deadline t J1 J5 J3 J4 J2 1 2 3 4 5 6 7 8 9 10 d1 d5 d3 d4 d2 Example: consider a set of five tasks that simultaneously arrived at time t = 0. Their worst-case computation times and deadlines are indicated in the above table. According to the EDD algorithm, the schedule of tasks is depicted above. The lateness of T1 to T5 is -2, -2, -3, -1, -2. Thus, the maximum lateness is -1, which is due to task J4.

5 Horn’s Algorithm Task model: Aperiodic tasks Arbitrary arrival times
Different computation time and deadlines Preemptive A scheduling problem in which preemption is allowed is always easier than its nonpreemptive counterpart Require a considerable amount of searching in non-preemptive scheduling algorithm when a new task need to be scheduled In contrast, if tasks are not synchronize but can be activated arbitrarily, then preemption become an important issue. In general, a scheduling problem that allows preemptive scheduling is always easier than non preemptive scheduling. To guarantee a newly arriving nonpreemptive task does not cause other nonpreemptive tasks require a considerable amount of searching. In contrast, if preemption is allowed, Horn proposed an elegant algorithm in 1974 to the problem of scheduling a set of n independent tasks with dynamic arrival times and preemption is allowed.

6 Horn’s Algorithm (Cont.)
Earliest Deadline First (EDF) algorithm proposed by Horn in 1974. Given a set of n independent tasks with arbitrary arrival times, any algorithm that at any instant executes the task with the earliest absolute deadline among all the ready tasks is optimal with respect to minimizing the maximum lateness. Schedulability condition ci(t) : the remaining worst-case execution time of Ji. Initially, ci(0) = Ci The statement should be clear enough from the slide.

7 Example J1 J2 J3 J4 J5 ai 2 3 6 Ci 1 di 5 4 10 9 ai:ith-taks’s arrival time Example, consider a set of five tasks whose arrival time a, computation time C, and deadline d are shown in above Table. According to the EDF algorithm, the schedule of tasks is depicted above. The lateness of T1 to T5 is -1, 0, 0, -1, -1. Thus, the maximum lateness is 0, which is due to task J2 and J3. t J1 J2 J3 J4 J5 1 2 3 4 5 6 7 8 9 10

8 Non-Preemptive Scheduling
Task model: Aperiodic tasks Arbitrary arrival times Different computation time and deadlines Non-Preemptive The problem of finding a feasible schedule is NP-hard If preemption is not allowed and tasks can have arbitrary arrivals, the problems of finding a feasible schedule becomes NP-hard.

9 Example J1 J2 ai 1 Ci 4 2 di 7 5 t J1 J2 1 2 3 4 5 6 7 8 d5 J1 J2 t 1
1 Ci 4 2 di 7 5 t J1 J2 1 2 3 4 5 6 7 8 Optimal schedule Example, consider a set of five tasks whose arrival time a, computation time C, and deadline d are shown in above Table. The optimal schedule that minimizes the maximal lateness is depicted in the first diagram. In contrast, the schedule produced by EDF is depicted in the second diagram. EDF does not produce a feasible schedule since J2 misses its deadline. J2 miss deadline d5 J1 J2 t 1 2 3 4 5 6 7 8 Infeasible EDF schedule,

10 Non-Preemptive Scheduling (Cont.)
Non-idle Algorithm: a scheduling algorithm that does not permit the processor to be idle when there are active jobs When arrival times are not known a priori and non-idle scheduling algorithms are allowed EDF is still optimal in a non-preemptive task model When arrival times are known a priori Branch-and-bound algorithms However, if the scheduling algorithm does not allow processor to be idle, called non-idle scheduling algorithms, then EDF is still optimal. If arrival times are known a prior, non-preemptive scheduling problems are usually solved by branch-and-bound algorithms. Nevertheless, the performance would degrade to exponential complexity that is computationally intractable. Thus, if the number of tasks is high, it cannot be used in practical systems. Some heuristic algorithm exists to limit the search space and reduce the computational complexity. However, we skip it in our class.

11 Reference Giorgio C. Buttazzo, “Hard Real-Time Computing Systems: Predictable Scheduling Algorithms and Applications,” Kluwer Academic Publishers, 1997 Jane W. S. Liu, “Real-Time Systems,” Prentice Hall, 2002


Download ppt "Aperiodic Task Scheduling"

Similar presentations


Ads by Google