Presentation is loading. Please wait.

Presentation is loading. Please wait.

1Spring 2015, arz1 CPE555A: Real-Time Embedded Systems Lecture 6 Ali Zaringhalam Stevens Institute of Technology CS555A – Real-Time Embedded Systems Stevens.

Similar presentations


Presentation on theme: "1Spring 2015, arz1 CPE555A: Real-Time Embedded Systems Lecture 6 Ali Zaringhalam Stevens Institute of Technology CS555A – Real-Time Embedded Systems Stevens."— Presentation transcript:

1 1Spring 2015, arz1 CPE555A: Real-Time Embedded Systems Lecture 6 Ali Zaringhalam Stevens Institute of Technology CS555A – Real-Time Embedded Systems Stevens Institute of Technology

2 2Spring 2015, arz22 Outline Scheduling Earliest-Due-Date (EDD) Earliest-Deadline-First (EDF) Latest Deadline First (LDF) Rate Monotonic Scheduling (RMS) CS555A – Real-Time Embedded Systems Stevens Institute of Technology

3 3Spring 2015, arz33 The Scheduling Problem Input A set of n tasks Γ = {τ1, τ2,..., τn}, A set of m processors P = {P1, P2,..., Pm} A set of s types of resources R = {R1,R2,..., Rs} Constraints: timing (deadline), precedence Output Assigning processors from P and resources from R to tasks from Γ in order to complete all tasks under the specified constraints This problem, in its general form, has been shown to be computationally intractable To make the problem of constructing feasible schedules tractable, certain assumptions are made CS555A – Real-Time Embedded Systems Stevens Institute of Technology

4 4Spring 2015, arz44 Scheduling Classification - 1 Preemptive The running task can be interrupted at any time to assign the processor to another active task, according to a predefined scheduling policy Non-preemptive A task, once started, is executed by the processor until completion. All scheduling decisions are taken when the current task terminates its execution CS555A – Real-Time Embedded Systems Stevens Institute of Technology

5 5Spring 2015, arz55 Scheduling Classification - 2 Static Scheduling decisions are based on fixed parameters (e.g. priority), assigned to tasks before their activation Dynamic Scheduling decisions are based on dynamic parameters (e.g. priority) that may change during task execution CS555A – Real-Time Embedded Systems Stevens Institute of Technology

6 6Spring 2015, arz66 Scheduling Classification - 3 Off-line All tasks are known at start & never change The scheduling algorithm is executed on the entire task set before task activation The schedule is stored in a table and later executed by a dispatcher On-line Tasks can arrive at run time The scheduling decisions are taken at runtime every time a new task enters the system or when a running task terminates CS555A – Real-Time Embedded Systems Stevens Institute of Technology

7 7Spring 2015, arz77 Scheduling Classification - 4 Optimal An optimal schedule minimizes some given cost function defined over the task set If there is no cost function, then the only concern is to achieve a feasible schedule meeting deadlines An algorithm is said to be optimal with respect to feasibility if it is able to find a feasible schedule, if one exists Heuristic Uses a heuristic approach in taking its scheduling decisions A heuristic algorithm tends toward the optimal schedule, but does not guarantee finding it CS555A – Real-Time Embedded Systems Stevens Institute of Technology

8 8Spring 2015, arz88 Guarantee-Based Algorithms A dynamic scheduler with real-time deadline and admission control A new task arrives The task is accepted only if the deadlines of current tasks are unaffected CS555A – Real-Time Embedded Systems Stevens Institute of Technology

9 9Spring 2015, arz99 Example Scheduler Metrics CS555A – Real-Time Embedded Systems Stevens Institute of Technology

10 10Spring 2015, arz10 Earliest Due Date (EDD) Jackson’s algorithm A set of n aperiodic tasks A single processor Optimization metric Minimizing maximum lateness L max =Max i (f i -d i ) Designation: 1 | sync | L max sync means that tasks arrive “synchronously”, at the same time Each task can have a different computation time and deadline But they all arrive at the same time CS555A – Real-Time Embedded Systems Stevens Institute of Technology

11 11Spring 2015, arz11 EDD Algorithm Given a set of n independent tasks, any algorithm that executes the tasks in order of non-decreasing deadlines is optimal with respect to minimizing the maximum lateness Because all tasks arrive at the same time, preemption is not an issue The static priority assigned to each task is the deadline: the shorter the deadline, the higher the priority We can assume that all tasks arrive at t=0 Each task is characterized by computation time and deadline (C,d) No random task arrival. All tasks arrive at the same time. CS555A – Real-Time Embedded Systems Stevens Institute of Technology

12 12Spring 2015, arz12 Proof of EDD Suppose there was a non-EDD schedule S. There must be two tasks a and b where a immediately precedes b but d a > d b. Why? The schedule can be improved to reduce maximum lateness by interchanging a and b No non-EDD schedule can do better in minimizing maximum lateness The complexity of the EDD algorithm is O(nxlogn): the complexity of the sorting algorithm CS555A – Real-Time Embedded Systems Stevens Institute of Technology

13 13Spring 2015, arz13 1.Tasks are scheduled as soon as the CPU is available. 2.There is no preemption. A task runs to completion. 3.If the schedule is feasible, all deadlines are met and f i -d i is negative for all i. Non-EDD: i finishes earlier but has a later deadline than j. In this example both fi-di and fj-dj are negative. Note that f j =f’ i because tasks execute consecutively EDD & Non-EDD Schedules Two cases for possible value of L’ max : L’ max = f’ i – d i = f j -d i <= f j – d j L’ max = f’ j – d j <= f j – d j The non-EDD L max = f j -d j So in both cases L’ max <= L max So EDD is no worst than non-EDD Non-EDD EDD CS555A – Real-Time Embedded Systems Stevens Institute of Technology

14 14Spring 2015, arz14 Example 1 J1J2J3J4J5 fi18473 di Li J4 has maximum lateness = -1 J1 J5 J3 J4 J2 Queue Dequeue CS555A – Real-Time Embedded Systems Stevens Institute of Technology

15 15Spring 2015, arz15 EDD & Feasibility EDD produces a schedule which minimizes maximum lateness But it may not be a feasible schedule in the sense of meeting all deadlines So EDD cannot be relied upon to obtain a feasible schedule meeting all deadlines But if there does exist a feasible schedule, then EDD can find it From any feasible schedule you can use EDD to obtain another feasible schedule which minimizes maximum lateness Complexity of EDD O(nlogn) – A heap sorting algorithm CS555A – Real-Time Embedded Systems Stevens Institute of Technology

16 16Spring 2015, arz16 Example 2 J1J2J3J4J5 fi di25486 Li -220 J1 J3 J2 J5 J4 Queue Dequeue Deadline missed CS555A – Real-Time Embedded Systems Stevens Institute of Technology

17 17Spring 2015, arz17 CS555A – Real-Time Embedded Systems Stevens Institute of Technology 17 The scheduler lets a task to continue to completion before scheduling another task There is no timer interrupt Dynamic Run-Time Scheduler The scheduler is invoked by the ISR or the OS service call invoked by the user

18 18Spring 2015, arz18 CS555A – Real-Time Embedded Systems Stevens Institute of Technology 18 Tasks are switched in and out when the timer interrupt kicks in and invokes the scheduler. Typically a lower numerical value represents a higher priority By user Or by the scheduler to prevent starvation of lower-priority tasks A non-preemptive priority-based scheduler allows a task to complete. The next task to run is determined by priority.

19 19Spring 2015, arz19 Earliest Deadline First (EDF) Horn’s algorithm N independent tasks with arbitrary arrival time. Tasks are not synchronous Preemption is allowed 1 | preemp | L max Optimization metric is the same as in EDD Minimizing maximum lateness L max =Max i (f i -d i ) CS555A – Real-Time Embedded Systems Stevens Institute of Technology

20 20Spring 2015, arz20 EDF Algorithm 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. Complexity O(n 2 ) if ready queue is a linear list O(nlogn) if the ready queue is implemented as a heap CS555A – Real-Time Embedded Systems Stevens Institute of Technology

21 21Spring 2015, arz21 EDF Proof This is a non-EDF feasible schedule Maximum lateness is Lmax=0 associated with J1 Preemption is allowed: so break up time in slices. Tasks can execute in disjointed intervals Interchanging the execution of J4 and J2 at t=4 does not increase maximum lateness Task J2 arrives at t=4. The scheduler rethinks the existing schedule and makes changes. CS555A – Real-Time Embedded Systems Stevens Institute of Technology At time t=4, the executing task J4 has a deadline of t d =15.  (t)=arrival time;  (t E )=execution time.

22 22Spring 2015, arz22 EDF Proof - Continued Interchange the execution of J2 and J4 at t=4. Maximum lateness remains the same at L=0 for J1 Continue this in all time slices After the interchange the resulting schedule is also feasible because the deadline of J4 is after the deadline associated with J2. CS555A – Real-Time Embedded Systems Stevens Institute of Technology

23 23 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz23 CS555A – Real-Time Embedded Systems Stevens Institute of Technology 23 Example Both J1 and J2 arrive at t=0. J1 is scheduled first because its deadline is (d1=2) < (d2=5). Completed tasks None

24 24 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz24 CS555A – Real-Time Embedded Systems Stevens Institute of Technology 24 Example - Continued J3 arrives at t=2. J3 has a deadline of d3=4 whereas the currently executing task J2 has a deadline of d2=5. Because d3 < d2, J2 is preempted and J3 is dispatched for execution. preemption Completed tasks J1

25 25 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz25 CS555A – Real-Time Embedded Systems Stevens Institute of Technology 25 Example - Continued J4 arrives at t=3. Its deadline is d4=10. The earliest deadline is still d3=4. So J3 remains in execution. No preemption at t=3. Completed tasks J1

26 26 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz26 CS555A – Real-Time Embedded Systems Stevens Institute of Technology 26 Example - Continued J5 arrives at t=6. Its deadline is d5=9. which is earlier than the d4=10 of J4 which is currently executing. So J4 is preempted and J5 is dispatched. preemption Completed tasks J1 J2 J3 L max = 0

27 27Spring 2015, arz27 Some Observations A schedule is computed at t=0 based on the ready tasks The schedule is re-examined only when a new task arrives You can view the task with the earliest deadline as having the highest priority If a feasible schedule (one that meets all deadlines) exists, EDF will find it. It also has the minimum lateness However an EDF schedule is not necessarily feasible (may not meet deadlines) CS555A – Real-Time Embedded Systems Stevens Institute of Technology

28 28Spring 2015, arz28 CS555A – Real-Time Embedded Systems Stevens Institute of Technology

29 29 CS555A – Real-Time Embedded Systems Stevens Institute of Technology Spring 2015, arz29 After task 1, task 4 has the earliest deadline but it cant’ be scheduled because it has a dependency on task 2 which must be scheduled first. So task 3 is the first EDF task meeting dependency requirements that can be scheduled. NO. Task 1: meets deadline d=2 Task 2: meets deadline d=5 Task 3: meets deadline d=4 Task 4: does NOT meet deadline d=3 Task 5: meets deadline d=5 Task 6: meets deadline d=6

30 30Spring 2015, arz30 CS555A – Real-Time Embedded Systems Stevens Institute of Technology

31 31Spring 2015, arz31 What’s nice about a leaf node is that no other task is dependent on it. LDF assumes a fixed, finite set of tasks with deadlines. No arrival of new tasks. No preemption. 6 Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology

32 32Spring 2015, arz32 CS555A – Real-Time Embedded Systems Stevens Institute of Technology

33 33Spring 2015, arz33 6 Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology

34 34Spring 2015, arz Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology

35 35Spring 2015, arz Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology

36 36Spring 2015, arz Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology

37 37Spring 2015, arz Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology

38 38Spring 2015, arz Stack Pop Stack Push CS555A – Real-Time Embedded Systems Stevens Institute of Technology

39 39Spring 2015, arz39 So it is also optimal with respect to feasibility. Why? The complexity of LDF is O(n 2 ). CS555A – Real-Time Embedded Systems Stevens Institute of Technology

40 40 CS555A – Real-Time Embedded Systems Stevens Institute of Technology 40 Spring 2015, arz

41 41 CS555A – Real-Time Embedded Systems Stevens Institute of Technology 41 EDF With Precedence r1=0 c1=1 d1=1 r2=0 c2=1 d2=5 r3=0 c3=1 d3=4 r4=0 c4=1 d4=3 r5=0 c5=1 d5=5 r6=0 c6=1 d6=6 Assume all tasks arrive at ai=ri=0 All tasks require execution time ci=1 Rule of thumb for this strategy: the deadline of a task cannot exceed its own deadline or the minimum slack time of its dependent tasks. e j is extecution time of task j

42 42 Timing Definitions - Continued Start time s i is the time at which a task starts its execution Finishing time f i is the time at which a task finishes its execution Response time R i is the difference between the finishing time and the request time: R i = f i − r i Lateness: L i = f i −d i represents the delay of a task completion with respect to its deadline; note that if a task completes before the deadline, its lateness is negative Laxity or Slack time: Xi = di − ai − Ci is the maximum time a task can be delayed on its activation to complete within its deadline /ri Xi = di − Ci when a i =0 Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

43 43 CS555A – Real-Time Embedded Systems Stevens Institute of Technology 43 EDF With Precedence r 1 =0 c 1 =1 d 1’ ’=1 r 2 =0 c 2 =1 d 2 =5 r 3 =0 c 3 =1 d 3 =4 r 4 =0 c 4 =1 d 4 =3 r 5 =0 c 5 =1 d 5 =5 r 6 =0 c 6 =1 d 6 =6 Start with i=1 Tasks immediately depending on 1 D(1) = {2, 3} d 2 -c 2 =4 d 3 -c 3 =3 d 1 ’=min(1, min(4,3))=1 Slack time: Xi = di − ai − Ci = di – Ci because ai = ri = 0 Rule of Thumb:The deadline of a task cannot exceed its own deadline or the minimum slack time of its dependent tasks. Spring 2015, arz

44 44 EDF With Precedence r 1 =0 c 1 =1 d 1’ ’=1 r 3 =0 c 3 =1 d 3 =4 r 4 =0 c 4 =1 d 4 =3 r 5 =0 c 5 =1 d 5 =5 r 6 =0 c 6 =1 d 6 =6 Next select i=2 with d 2 =5 Tasks immediately depending on 2 D(2) = {4, 5} d 4 -c 4 =2 d 5 -c 5 =4 d 2 ’=min(5, min(2,4))=2 r 2 =0 c 2 =1 d 2’ ’=2 Slack time: Xi = di − ai − Ci = di – Ci because ai = ri = 0 Rule of Thumb:The deadline of a task cannot exceed its own deadline or the minimum slack time of its dependent tasks. Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

45 45 EDF With Precedence r 1 =0 c 1 =1 d 1’ ’=1 r 3 =0 c 3 =1 d 3 ’=4 r 4 =0 c 4 =1 d 4 =3 r 5 =0 c 5 =1 d 5 =5 r 6 =0 c 6 =1 d 6 =6 Next select i=3 with d 3 =4 Tasks immediately depending on 3 D(3) = {6} d 6 -c 6 =5 d 3 ’=min(4, min(5))=4 r 2 =0 c 2 =1 d 2’ ’=2 Slack time: Xi = di − ai − Ci = di – Ci because ai = ri = 0 The deadline of a task cannot exceed its own deadline or the minimum slack time of its dependent tasks. Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

46 46 EDF With Precedence r 1 =0 c 1 =1 d 1’ ’=1 r 3 =0 c 3 =1 d 3 ’=4 r 4 =0 c 4 =1 d 4 ’=3 r 5 =0 c 5 =1 d 5 ’=5 r 6 =0 c 6 =1 d 6 ’=6 The remaining nodes are leaf nodes. No other task depends on them So their deadlines remain unchanged r 2 =0 c 2 =1 d 2’ ’=2 Slack time: Xi = di − ai − Ci = di – Ci because ai = ri = 0 The deadline of a task cannot exceed its own deadline or the minimum slack time of its dependent tasks. Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

47 47 EDF With Precedence r 1 =0 c 1 =1 d 1’ ’=1 r 3 =0 c 3 =1 d 3 ’=4 r 4 =0 c 4 =1 d 4 ’=3 r 5 =0 c 5 =1 d 5 ’=5 r 6 =0 c 6 =1 d 6 ’=6 Now apply normal EDF: Task 1 Task 2 Task 4 Task 3 Task 5 Task 6 r 2 =0 c 2 =1 d 2’ ’=2 EDF with precedence rationalizes deadlines. Instead of accepting the given deadline, the algorithm ensures that the assigned “virtual” deadlines take into account deadlines of successor. A task cannot have a later deadline than the minimum slack of its successors. Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

48 48 Optimality EDF with precedence is optimal in the sense of minimizing maximum lateness A schedule obtained may not be feasible Tasks may not meet their deadline But if a feasible schedule exists, EDF with precedence will find it. 48Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

49 49 Periodic Tasks A periodic task is a sequence of jobs that are released at times 0+  i, T i +  i, 2 T i +  i, … A periodic task  i is specified using the parameters T i – period C i – maximum execution time  i – phase or offset (almost always zero) D i – relative deadline (almost always Ti) T Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

50 50 Sporadic Tasks Sporadic tasks are characterized by a minimum inter-arrival time, rather than a fixed period (the earliest, the task arrives again) Minimum spacing is necessary to ensure execution within C (maximum execution time) Many of the analysis for periodic tasks apply to sporadic tasks if T i is interpreted as the minimum time between arrivals Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

51 51 Scheduling Points Scheduling point is where the scheduler must examine the schedule and make scheduling decisions This includes preemption of the currently running task For periodic tasks, the scheduler kicks in at the fixed period For sporadic tasks, the scheduler kicks in when tasks arrive Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

52 52 Scheduling Assumptions The instances of a periodic task  i are regularly activated at a constant rate. The interval T i between two consecutive activations is the period of the task 2. All instances of a periodic task  i have the same worst-case execution time C i 3. All instances of a periodic task  i have the same relative deadline D i which is equal to the period T i What’s relative deadline? Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

53 53 Scheduling Assumptions All tasks in the task set are independent; that is, there are no precedence relations and no resource constraints 5. No task can suspend itself, for example on I/O operations 6. All tasks are released as soon as they arrive (a i =r i ) 7. All context-switching overheads are assumed to be zero Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

54 54 Hyperperiod Or Major Cycle A periodic system schedule can be defined by giving a finite-length schedule that is repeated over and over. The length of the smallest such schedule is called the hyperperiod for that task set For a purely periodic task set, the hyperperiod is given by the Least Common Multiple of the periods Hyperperiod = LCM(T i ) for all i Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

55 55 Harmonic Task Set A periodic task set is harmonic if Every period evenly divides all larger periods Every period is evenly divisible by all smaller periods The hyperperiod of a harmonic task set is equal to the largest task period (because it is the LCM!) Example: three tasks with periods 25, 50 and /50=2; 100/25=4; 50/25=2 100:50:25 = 4:2:1 Hyperperiod: 100 Scheduling algorithms may be simpler and more efficient for harmonic task sets Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

56 56 Timeline Scheduling Time Line Scheduling It is an off-line static scheduling strategy Divide the time line into time slices for scheduling purposes Use the Greatest Common Divisor of the Task Periods as the time slice This is the same as the smallest period in a harmonic task set It is referred to as the Minor Cycle Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

57 57 Example Hyperperiod Must be scheduled every 25 units. Must be scheduled every 50 units. Must be scheduled every 100 units. Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology Three tasks with periods 25, 50, 100 Hyperperiod/Major cycle (LCM): 100 Time slice/minor cycle (GCD) : 25 A feasible schedule exists if C A +C B < 25 C A +C C < 25 These are sufficiency conditions. They are not necessary conditions (i.e., there may be feasible solutions even if these conditions are not met.

58 58 Timeline Scheduling Notes Advantage: design simplicity A timer interrupts every “minor cycle” A table-driven scheduler executes programs in the order computed in the major cycle Disadvantage: Could cause instability during CPU overload if a task does not terminate at the minor-cycle boundary Difficult to maintain a static schedule when task periods or execution times change Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

59 59 Rate-Monotonic Scheduling Assume n tasks running periodically Periods: T 1, T 2,….T n Worst-case execution time: C 1, C 2,….C n Relative deadline (relative to release time) D i = T i No precedence constraints Preemptive with fixed/static priorities Theorem: if any static priority assignment yields a feasible schedule, then priorities ordered by period (smallest period has the highest priority) also yields a feasible schedule Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

60 60 Optimal Feasibility Optimality with respect to feasibility means: if there is a feasible schedule S, then RMS can also schedule it If RMS executes every task to completion once within its designated period, then it satisfies the feasibility objective There may be other feasible schedules that are not RMS Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

61 61Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

62 62Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

63 63Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

64 64 Note that if we make the red task longer, at some point the blue task may not be able to complete within C1 and misses its deadline. In this case there is no feasible RMS solution. finish The scheduler kicks in whenever a task arrives at its periodic interval. Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

65 65Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology The worst-case processor demand occurs when all tasks are released simultaneously. This is referred to as the critical instant. The response time is longest.

66 66 We have two tasks RMS solution: T2 has a higher priority Non-RMS solution: which task has a higher priority? Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

67 67 With only two tasks, the non-RMS schedule is the one where the blue task with the longer period has a higher priority. So we have to only consider feasible non-RMS scheduling scenarios. Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

68 68Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

69 69 Comments The proof can be extended to an arbitrary number of tasks The proof is for optimality with respect to feasibility. Other optimality criteria such as processor utilization are not considered. In fact RMS schedulers cannot always achieve 100% utilization. RMS is essentially a preemptive scheduling algorithm with fixed priority given by the task period Spring 2015, arz

70 70 What Have We Shown? We have shown that in cases where there exists a feasible scheduling solution under conditions stated in the theorem, the RMS scheduling algorithm also works RMS is optimal in the sense that it yields a feasible solution when there exists a feasible solution under any strategy This is called: optimality with respect to feasibility Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

71 71 What Have We Shown? If C 1 +C 2 >T 2, a non-RMS solution does not exist in the two-task example RMS does not have to satisfy this constraint Therefore it can cover more than non-RMS solutions But there may be cases where there is no feasible solution. In these cases RMS can’t help either. Examples: Suppose in the two-task example, the period of the longer task is shorter Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology

72 72 Example: Infeasible RMS Schedule Deadline Miss timeprocessing period),(  iiiii CTCTP )1,4( 1  P )2,5( 2  P)2,7( 3  P 1 st run 2 nd run 1 st run 2 nd run 1 st run 1 st run 3 rd run Spring 2015, arz CS555A – Real-Time Embedded Systems Stevens Institute of Technology


Download ppt "1Spring 2015, arz1 CPE555A: Real-Time Embedded Systems Lecture 6 Ali Zaringhalam Stevens Institute of Technology CS555A – Real-Time Embedded Systems Stevens."

Similar presentations


Ads by Google