Resource management and priorities in RealTime Systems - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Resource management and priorities in RealTime Systems

Description:

Several tasks access software and hardware objects where mutual exclusion is necessary. ... Pre-emption of tasks in their critical sections ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 14
Provided by: janlin6
Category:

less

Transcript and Presenter's Notes

Title: Resource management and priorities in RealTime Systems


1
Resource management and priorities in Real-Time
Systems
  • Jan Lindström

2
Contents
  • Objectives
  • Resources
  • Priority inversion problem
  • Methods to avoid priority inversion
  • Priority inheritance protocol
  • Summary

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 ?

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) --- ltcritical
    sectiongt--- unlock(resource)

5
Priority inversion problem
lock(R)
unlock(R)
lock(R)
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).

7
Mars Pathfinder
  • Landed 4.7.1997
  • Experiences software glitches.
  • http//research.microsoft.com/mbj/Mars_Pathfinder
    /Mars_Pathfinder.html

8
Priority inversion in Mars Pathfinder
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.

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.

11
Example of priority inheritance
blocked
T1
T2
T3
without priority inheritance
prio(T1) gt prio(T2) gt prio(T3)
T1
T2
T3
with priority inheritance
prio(T3) prio(T1)
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).

13
Summary
  • Critical sections have negative effect on
    schedulabitity and predictability.
  • Critical sections can cause priority inversion
    problem.
  • Priority inheritance can control priority
    inversion.
Write a Comment
User Comments (0)
About PowerShow.com