Priority Inheritance
   HOME

TheInfoList



OR:

In
real-time computing Real-time computing (RTC) is the computer science term for hardware and software systems subject to a "real-time constraint", for example from event to system response. Real-time programs must guarantee response within specified time constrai ...
, priority inheritance is a method for eliminating unbounded
priority inversion In computer science, priority inversion is a scenario in scheduling in which a high priority task is indirectly superseded by a lower priority task effectively inverting the assigned priorities of the tasks. This violates the priority model that h ...
. Using this programming method, a process scheduling
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algorithms are used as specificat ...
increases the priority of a process (A) to the maximum priority of any other process waiting for any
resource Resource refers to all the materials available in our environment which are technologically accessible, economically feasible and culturally sustainable and help us to satisfy our needs and wants. Resources can broadly be classified upon their ...
on which A has a resource lock (if it is higher than the original priority of A). The basic idea of the priority inheritance protocol is that when a job blocks one or more high-priority jobs, it ignores its original priority assignment and executes its
critical section In concurrent programming, concurrent accesses to shared resources can lead to unexpected or erroneous behavior, so parts of the program where the shared resource is accessed need to be protected in ways that avoid the concurrent access. One way to ...
at an elevated priority level. After executing its critical section and releasing its locks, the process returns to its original priority level.


Example

Consider three jobs: Suppose that both H and L require some shared resource. If L acquires this shared resource (entering a critical section), and H subsequently requires it, H will block until L releases it (leaving its critical section). Without priority inheritance, process M could
preempt Preempt (also spelled "pre-empt") is a bid in contract bridge whose primary objectives are (1) to thwart opponents' ability to bid to their best contract, with some safety, and (2) to fully describe one's hand to one's partner in a single bid. A ...
process L during the critical section and delay its completion, in effect causing the lower-priority process M to indirectly preempt the high-priority process H. This is a
priority inversion In computer science, priority inversion is a scenario in scheduling in which a high priority task is indirectly superseded by a lower priority task effectively inverting the assigned priorities of the tasks. This violates the priority model that h ...
bug. With priority inheritance, L will execute its critical section at H's high priority whenever H is blocked on the shared resource. As a result, M will be unable to preempt L and will be blocked. That is, the higher-priority job M must wait for the critical section of the lower priority job L to be executed, because L has inherited H's priority. When L exits its critical section, it regains its original (low) priority and awakens H (which was blocked by L). H, having high priority, preempts L and runs to completion. This enables M and L to resume in succession and run to completion without priority inversion.


Operating systems supporting priority inheritance

*
FreeRTOS FreeRTOS is a real-time operating system kernel for embedded devices that has been ported to 35 microcontroller platforms. It is distributed under the MIT License. History The FreeRTOS kernel was originally developed by Richard Barry around ...
* Microsoft Azure RTOS, formerly Express Logic's ThreadX *
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
*
VxWorks VxWorks is a real-time operating system (or RTOS) developed as proprietary software by Wind River Systems, a wholly-owned subsidiary of Aptiv. First released in 1987, VxWorks is designed for use in embedded systems requiring real-time, determin ...


See also

*
Priority ceiling protocol In real-time computing, the priority ceiling protocol is a synchronization protocol for shared resources to avoid unbounded priority inversion and mutual deadlock due to wrong nesting of critical sections. In this protocol each resource is assign ...


References

*


External links

*
Priority Inheritance: The Real Story
by Doug Locke *
Against Priority Inheritance
by
Victor Yodaiken The name Victor or Viktor may refer to: * Victor (name), including a list of people with the given name, mononym, or surname Arts and entertainment Film * ''Victor'' (1951 film), a French drama film * ''Victor'' (1993 film), a French shor ...
*
Implementing Concurrency Control With Priority Inheritance in Real-Time CORBA
by Steven Wohlever,
Victor Fay Wolfe The name Victor or Viktor may refer to: * Victor (name), including a list of people with the given name, mononym, or surname Arts and entertainment Film * ''Victor'' (1951 film), a French drama film * ''Victor'' (1993 film), a French shor ...
and Russell Johnston *
Priority Inheritance Spin Locks for Multiprocessor Real-Time Systems
by Cai-Dong Wang,
Hiroaki Takada Hiroaki is a masculine Japanese given name in modern times consist of a family name (surname) followed by a given name, in that order. Nevertheless, when a Japanese name is written in the Roman alphabet, ever since the Meiji era, the official ...
and
Ken Sakamura Ken or KEN may refer to: Entertainment * ''Ken'' (album), a 2017 album by Canadian indie rock band Destroyer. * ''Ken'' (film), 1964 Japanese film. * ''Ken'' (magazine), a large-format political magazine. * Ken Masters, a main character in t ...
*
Hardware Support for Priority Inheritance
by Bilge E. S. Akgul, Vincent J. Mooney,
Henrik Thane Henrik is a male given name of Germanic origin, primarily used in Scandinavia, Estonia, Hungary and Slovenia. In Poland, the name is spelt Henryk but pronounced similarly. Equivalents in other languages are Henry (English), Heiki (Estonian), Heikk ...
and Pramote Kuacharoen Real-time computing Concurrency control {{compu-sci-stub