Presentation is loading. Please wait.

Presentation is loading. Please wait.

Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.

Similar presentations


Presentation on theme: "Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University."— Presentation transcript:

1 Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University

2 Real-Time Scheduling Earliest Deadline First (EDF) Rate Monotonic Scheduling (RMS) 2

3 Rate Monotonic Scheduling Based on fixed priorities The shorter the period of the task, the higher the priority assigned Example: P1 = (3, 4, 4) P2 = (2, 8, 8) 3

4 RM Scheduling 4 P1 = (3, 4, 4) P2 = (2, 8, 8)

5 Least Compute Time (LCT) Also based on fixed priorities The shorter the compute time of the task, the higher the priority assigned Example: P1 = (3, 4, 4) P2 = (2, 8, 8) P2 will have higher priority. P1 will missed its first deadline 5

6 RT Scheduling with Dynamic Priorities Shortest Completion Time (SCT) Earliest Deadline First (EDF) Least Slack Time (LST) 6

7 7 Earliest Deadline First Scheduling: EDF Based on dynamic priorities. EDF scheme: Choose the task with the earliest (current) deadline Preemptive: scheduling decision made when a task finishes as well as when a new task arrives Theorem: If there is a possible schedule, then EDF will find one Example: Two processes: P1 (2, 4, 4) and P2 (5, 10, 10)

8 EDF Example 1 8 P1 (2, 4, 4) and P2 (5, 10, 10) At times t=4 and t=12, P2 is preempted

9 9 Task T1 with period 10 and CPU time 3 Task T2 with period 10 and CPU time 1 Task T3 with period 15 and CPU time 8 0 3 4 10 12 1516 20 2324 28 EDF Example 2 T1T2T3 T1T2T3T1T2T3

10 10 Scheduling Algorithm: RMS Rate Monotonic Scheduling (Liu and Layland, 1973) Based on static priorities. Preemptive: scheduling decision made when a task finishes as well as when a new task arrives Scheduling algorithm: Choose the task with smallest period (among ready tasks) Theorem: If utilization is smaller than 0.7, then RMS is guaranteed to find one If utilization is between 0.7 to 1, RMS may or may not succeed Example:

11 11 Priority Inversion 1. T1 has highest priority, T2 next, and T3 lowest 2. T3 comes first, starts executing, and acquires some resource (say, a lock). 3. T1 comes next, interrupts T3 as T1 has higher priority 4. But T1 needs the resource locked by T3, so T1 gets blocked 5. T3 resumes execution 6. T2 arrives, and interrupts T3 as T2 has higher priority than T3, and T2 executes till completion 7. In effect, even though T1 has priority than T2, and arrived earlier than T2, T2 delayed execution of T1 8. This is “priority inversion” !! Not acceptable. 9. Solution T3 should inherit T1’s priority at step 5

12 RM Scheduling RM scheduling is optimal with respect to maximum utilization over all static-priority schedulers. However, this scheduling policy only supports tasks that fit the periodic task model, since priorities depend upon request periods. Because the request times of aperiodic tasks are not always predictable, these tasks are not supported by the RM algorithm

13 The EDF Scheduling The EDF scheduling algorithm is a preemptive and dynamic priority scheduler that executes tasks in order of the time remaining before their corresponding deadlines. Tasks with the least time remaining before their deadline are executed before tasks with more remaining time. At each invocation of the scheduler, the remaining time is calculated for each waiting task, and the task with the least remaining time is dispatched. If a task set is schedulable, the EDF algorithm results in a schedule that achieves optimal resource utilization.

14 However, EDF is shown to be unpredictable if the required utilization exceeds 100%, known as an overload condition. EDF is useful for scheduling aperiodic tasks, since the dynamic priorities of tasks do not depend on the determinism of request periods.

15 EDF Earliest deadline first (EDF) scheduling is a dynamic scheduling principle used in real- time operating systems.schedulingreal- time operating systems It places processes in a priority queue.priority queue Whenever a scheduling event occurs (task finishes, new task released, etc.) the queue will be searched for the process closest to its deadline. This process will then be scheduled for execution next.


Download ppt "Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University."

Similar presentations


Ads by Google