2 Outline About real time systems Basic Scheduling Techniques Recent WorkFuture Work
3 Real Time SystemsCorrectness of the system may depend not only on the logical result of the computation but also on the time when these results are producedTasks attempt to control events or to react to events that take place in the outside worldThese external events occur in real time and processing must be able to keep upProcessing must happen in a timely fashion, neither too late, nor too earlySome examples include, Air Traffic Control, Robotics, Controlling Cars/Trains, Medical Support, Multimedia.
4 Types of Real Time Systems Hard real time systemsMust always meet all deadlinesSystem fails if deadline window is missedSoft real time systemsMust try to meet all deadlinesSystem does not fail if a few deadlines are missedFirm real time systemsResult has no use outside deadline windowTasks that fail are discarded
5 Real time tasks Periodic - Each task is repeated at a regular interval - Max execution time is the same each period- Arrival time is usually the start of the period- Deadline is usually the endAperiodic- Each task can arrive at any time
6 Real-Time Scheduling Determines the order of real time task executions Dynamic vs. StaticDynamic schedule computed at run-time based on tasks really executing, priorities computed on the flyStatic schedule done at compile time for all possible tasks, priorities are already known
7 Rate Monotonic Simplest type of real time scheduling - Tasks are periodic, with hard deadlines- Tasks are completely independent and do not communicate with each other- Tasks are scheduled according to priority and task priorities are fixed- Computation time is known and constant
8 Rate MonotonicHigher priorities usually assigned to tasks with smaller periodsIf t(h) < t(l), then PR(h) > PR(l), where t indicated period and PR indicates the priority. This is called rate monotonic priority assignment.Calculates the critical instant for each task.Occurs when task Ti and all higher priority tasks are scheduled simultaneouslyIf tasks deadline scheduled at critical instant, then the task can always meet its deadline.
9 Deadline Monotonic Tasks with shorter deadlines get higher priority. Static Scheduling.If D(h) < D(l), then PR(h) > PR(l), where D indicates the deadline. This is called Deadline Monotonic priority assignment.
10 EDF: Earliest Deadline First Dynamic SchedulingAssume a preemptive system with dynamic prioritiesLike deadline monotonic, the task with shortest deadline gets highest priority, but the difference is real time priorities can vary during the system’s execution. Priorities are reevaluated when events such as task arrivals, completions occur
11 Real Time Synchronization Required when tasks are not independent and need to share information and synchronizeIf two tasks want to access the same data, semaphores are used to ensure non-simultaneous accessPotential IssuesPriority Inversion – A situation in which a higher priority job is blocked by lower priority jobs for an indefinite period of timeChain Blocking – A situation in which more than two resources are available and a high priority task is blocked off from both because of two or more lower priority tasks holding locks on one or both of the resources.
12 Priority InversionsLow priority task holds resource that prevents execution of higher priority tasks.- Task L acquires lock- Task H needs resource, but is blocked by Task L, so Task L is allowed to execute- Task M preempts Task L, because it is higher priority- Thus Task M delays Task L, which delays Task H
13 Priority Inheritance Protocol PIP eliminates priority inversion problemThe algorithm will increase the priority of a task to the maximum priority of any task waiting for any resource the task has a resource lock on- i.e. if a lower priority task L has a lock on a resource required by a higher priority task H, then the priority of the lower task is increased to the priority of the higher task- Once the lock is released the task resumes back its original priority
14 Priority Ceiling Protocol Each resource is assigned a priority ceiling, which is a priority equal to the highest priority of any task which may lock the resource.PCP eliminates chain blocking which considers the use of more than one resource or semaphoreA task can acquire a lock on resource S only if no other task holds a lock on resource R. Thus higher priority tasks will not be blocked through both S and RIf a high priority task is blocked through a resource, then the task holding that resource gets the priority of the high priority task. Once the resource is released, the priority is reset back to its original
15 Recent WorkSemaphore queue priority assignment for real-time multiprocessor synchronizationHardware support for Priority Inheritance using System-on-a-Chip Lock Cache (SoCLC)Separate cache allocated on a chip for handling lock hand-offs. Improves real-time predictability of the system and improves performanceDeferrable scheduling for fixed priority systemsE.g. Actively schedule the maximum time between periodic sensor updates to minimize energy consumption in a wireless sensor network.
16 Future WorkEnhancements in Multiprocessor and Distributed environments resulting in better utilization of resourcesReal time scheduling algorithms for Artificial Intelligent systems that take decisions and prioritize execution of tasks based on heuristicsContext-Aware Scheduling- the decision of which job to schedule next should be based on the deadline of the job as well as the context of resources being managed
17 ReferencesChow, Randy, et. al.,Distributed Operating Systems & Algorithms, Addison Wesley, March 18, 1997M. Xiong, S. Han and K.Y. Lam, ”A Deferrable Scheduling Algorithm for Real-Time Transactions Maintaining Data Freshness,” IEEE Real-Time Systems Symposium, 2005.2007Sha, L.; Rajkumar, R.; Lehoczky, J.P.; Priority inheritance protocols: an approach to real-time synchronization, Computers, IEEE Transactions on Volume 39, Issue 9, Sept Page(s):1175 – 1185Gupta, Kanishka; Matta, Ibrahim; Bestavroz, Azer; Context Aware Real Time Scheduling, Boston University