Rtos Faq Vector
Rtos Faq Vector
Rtos Faq Vector
Context Context
Interrupt
Latency
Recovery
Interrupt Response
TIME
ISR entry
Context ISR exit Context
function
saved function restored
TASK A Task A
Interrupt
Latency
Interrupt
Recovery
Interrupt Latency
Example:
• Let T1 , T2 , and T3 be the three periodic tasks with
decreasing order of priorities.
• Let T1 and T3 share a resource “S”.
Makes a A higherResource S is
available and T1
priority task
Priority Inversion example
request for
resource S and waits for ais scheduled
gets blocked lower priority here
T1 task
Highest T1 T1
priority
T2 completes
L1
Preempted by
higher priority T3 completes
T2 T3 is the T2
task T1
Medium only
priority active Preempted by
task higher K3
priority
K1 K2 task T2
T3 T3 T3 T3
Least
priority 0
T1 and T3
share
resource Total blocking time for task T1 = (K1+K2+K3) + (L1)
S
Priority Inheritance Protocol
• priority inheritance protocol—ensures that
the priority level of the lower priority task
that has acquired the mutex is raised to that of
the higher priority task that has requested the
mutex when inversion happens. The priority of
the raised task is lowered to its original value
after the task releases the mutex that the higher
priority task requires.
Priority Ceiling Protocol
• ceiling priority protocol—ensures that the priority
level of the task that acquires the mutex is
automatically set to the highest priority of all
possible tasks that might request that mutex when
it is first acquired until it is released.
• Similarly to the ceiling priority protocol, the priority
of every task is known in the priority ceiling
protocol. The resources that every task requires
are also known before execution. The current
priority ceiling for a running system at any time is
the highest priority ceiling of all resources in use
at that time.
Priority Inversion - Real-world
Example
• Mars Pathfinder mission (July 4, 1997)
• VxWorks (real-time OS), preemptive priority scheduling of threads
(e.g., RMS)