1 / 13

Resource management and priorities in Real-Time Systems

Resource management and priorities in Real-Time Systems. Jan Lindström. Contents. Objectives Resources Priority inversion problem Methods to avoid priority inversion Priority inheritance protocol Summary. Objectives. What are shared resources ?

Download Presentation

Resource management and priorities in Real-Time Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Resource management and priorities in Real-Time Systems Jan Lindström Real-Time Systems, J. Lindström

  2. Contents • Objectives • Resources • Priority inversion problem • Methods to avoid priority inversion • Priority inheritance protocol • Summary Real-Time Systems, J. Lindström

  3. Objectives • What are shared resources ? • Why resources influence scheduling of the real-time tasks ? • What is priority inversion problem ? • What methods there are to avoid priority inversion problem ? • How does priority inheritance work ? Real-Time Systems, J. Lindström

  4. Shared resources • Several tasks access software and hardware objects where mutual exclusion is necessary. • Resource allocated to one job at time. Once allocated, held by the job until no longer needed. • Examples: semaphores, locks, servers,… • Operations: lock(resource) --- <critical section>--- unlock(resource) Real-Time Systems, J. Lindström

  5. Priority inversion problem lock(R) unlock(R) lock(R) Real-Time Systems, J. Lindström

  6. Pre-emption of tasks in their critical sections • Negative effect on schedulability and predictability. • Traditional resource management algorithms fail. ( They decouple resource management decisions from scheduling decisions). Real-Time Systems, J. Lindström

  7. Mars Pathfinder • Landed 4.7.1997 • Experiences software glitches. • http://research.microsoft.com/~mbj/Mars_Pathfinder/Mars_Pathfinder.html Real-Time Systems, J. Lindström

  8. Priority inversion in Mars Pathfinder Real-Time Systems, J. Lindström

  9. Avoiding priority inversion • Non-preemptive critical sections • Causes unpredictable waiting time. • Usable only to short critical sections. • Entry protocols for critical sections • Priority Inheritance Protocol. • Priority Ceiling Protocol. Real-Time Systems, J. Lindström

  10. Priority inheritance protocol Under this protocol, if a higher priority task TH is blocked by a lower priority task TL, because TL is currently executing critical section needed by TH, TL temporarily inherits the priority of TH. When blocking ceases (i.e., TL exits the critical section), TL resumes its original priority. Unfortunately, priority inheritance may lead to deadlock. Real-Time Systems, J. Lindström

  11. Example of priority inheritance blocked T1 T2 T3 prio(T1) > prio(T2) > prio(T3) without priority inheritance T1 T2 T3 with priority inheritance prio(T3) = prio(T1) Real-Time Systems, J. Lindström

  12. Complexity of scheduling • ”When there are mutual exclusion constraints in a system, it is impossible to find an optimal on-line scheduling algorithm (unless it is clairvoyant).” (Mok, 1983) • ”The problem of deciding feasibility for set of periodic tasks which use semaphores to enforce mutual exclusion is NP-hard.” (Mok, 1983). Real-Time Systems, J. Lindström

  13. Summary • Critical sections have negative effect on schedulabitity and predictability. • Critical sections can cause priority inversion problem. • Priority inheritance can control priority inversion. Real-Time Systems, J. Lindström

More Related