What is priority inversion?

Answers were Sorted based on User's Feedback



What is priority inversion?..

Answer / achal ubbott

Priority inversion is a serious problem if it is
unbounded.A high priority task is said to undergo PI ,if it
has to wait for a resource,already held by a low priority
task. the LPT cannot release it because it gets preemptied
by tasks of intermediate priorities. solution to this is
priority inheritance .

Is This Answer Correct ?    39 Yes 6 No

What is priority inversion?..

Answer / venkatgopu

Priority inversion is a situation where in lower priority
tasks will run blocking higher priority tasks waiting for
resource (mutex).

priority: A(High) B(Medium) C(Low)

C was ready to run. So C starts running. locks mutex

A is ready to run. Bcz of A is higher priority than C, A
gets the CPU (otherwords C relinguishes CPU).
While executing "A" task, it's need of resource(mutex) but
it locked by lower priority task "C". so task "A" going to
be waiting state(priority inversion)

B is ready to run. Bcz B is Higher priority than C, B get
the CPU frm C.

For task "B", its no need of any resource(mutex). so it
wont be waiting for any task to get resource. it will be
finished first.

Then, Task "C" gets CPU from task "B" and finished its
task, and reliese the resource(mutex).

Task C (waiting task for resource)then gets mutex finish
execution..

Here:

B(M) task finished exe first
C(L) task finished exe second
A(H) task finished exe last even its have higher priority
than both B and C

The solution to priority inversion is Priority inheritance

Is This Answer Correct ?    35 Yes 3 No

What is priority inversion?..

Answer / saleem

Priority inversion is a situation where in lower priority
tasks will run blocking higher priority tasks waiting for
resource (mutex). For ex: consider 3 tasks. A, B and C, A
being highest priority task and C is lowest. Look at
sequence of context swaps

A goes for I/O . unlocks mutex.
C was ready to run. So C starts running. locks mutex
B is ready to run. Swaps out C and takes mutex.
A is ready to run. but A is blocked as mutex is locked by B.
but B will never relinqishes the mutex as its higher
priority than C.

The solution to priority inversion is Priority inheritance.

Is This Answer Correct ?    56 Yes 31 No

What is priority inversion?..

Answer / sunita

Priority inheritance and Priority ceiling can be used to
avoid Priority Inversion depending upon what RTOS support is
available.

Is This Answer Correct ?    18 Yes 7 No

What is priority inversion?..

Answer / sriniv

Take three tasks A,B and C.

A - High.
B - Medium.
C - Low.

C is scheduled and running and locks a resource which is
shared with A. Now B is scheduled and taked the CPU time so
it starts running keeping C in wait state.

Now A is scheduled which is the higher priority task than B
and C and gets the CPU time and it starts running. But it
needs the shared resource which is locked by task C. So A
waits for that resource.

Now CPU starts servicing task B as it has higher priority
than C. A is suppose to wait till task B is finished even
though it has highest priority than B. To avoid this
situation exchange the priority levels of A and C. After
this C will become highest priority and gets the CPU time
by suspending task B. Task C will be serviced and releases
resource shared with task A. As soon as task C is released
the shared resource change the prority levels of A and C
again. Now A will become highest priority than C and CPU
starts running Task A.

This is called Proirity inversion.

Is This Answer Correct ?    12 Yes 2 No

What is priority inversion?..

Answer / manojkumar

In scheduling, priority inversion is the scenario where a
low priority task holds a shared resource that is required
by a high priority task. This causes the execution of the
high priority task to be blocked until the low priority task
has released the resource, effectively "inverting" the
relative priorities of the two tasks.

The MARS Pathfinder problem is a good example to this
question. In this problem low priority jobs held a
system-wide important resource, in this case a
mutex on the data bus. The path finder suffered from
*priority inversion problem*.

Is This Answer Correct ?    10 Yes 3 No

What is priority inversion?..

Answer / pandiarajan.

A and C have shared resource so they use mutex. but B is not
using share resource of A and C. so B can swap out c and
start run. now A is ready to run but resource is locked by
C. after B finished C will continue..and B wise versa.. A
still wait to run.

Is This Answer Correct ?    11 Yes 5 No

What is priority inversion?..

Answer / balu

Whenever the highest priority task that is
otherwise enabled is not executing
1 Usual cause – contention for limited quantity
resource with a lower priority task
2 For example, a lower priority task has locked a
resource while in a critical section

Is This Answer Correct ?    4 Yes 2 No

What is priority inversion?..

Answer / ahmed hamdy

When using priority scheduling, it is
important that the RTOS has a sufficient number of
priority levels, so that applications with stringent
priority requirements can be implemented [13].
Unbounded priority inversion occurs when a higher priority
task must wait on a low priority task
to release a resource while the low priority task is waiting
for a medium priority task. The RTOS
can prevent priority inversion by giving the lower
priority task the same priority as the higher
priority task that is being blocked (called priority
inheritance). In this case, the blocking task can
finish execution without being preempted by a medium
priority task. The designer must make
sure that the RTOS being used prevents unbounded priority
inversion

Is This Answer Correct ?    1 Yes 0 No

What is priority inversion?..

Answer / boopathi

"A goes for I/O . unlocks mutex.
C was ready to run. So C starts running. locks mutex
B is ready to run. Swaps out C and takes mutex.
A is ready to run. but A is blocked as mutex is locked by B.
but B will never relinqishes the mutex as its higher
priority than C."

From the above, I understand the task B swaps C and takes
mutex. After this task A becomes ready and sees the mutex is
locked by B. Why cant A again swap B (Because A has higher
priority than B)? Im confused here, Please reply.

Is This Answer Correct ?    8 Yes 10 No

Post New Answer

More Vxworks Interview Questions

Which RTOS supports Non-Preemptive scheduling ? Why other scheduling methods are supported by such Oses?

1 Answers   Elico,


IN RTOS HAVING 1OKBYTES OF MEMORY AND YOUR PROGRAMM FOR ASKING FOR 5KBYTES AND YOU GOT NULL ERROR ? WHY DOES IT BEHAVES LIKE THIS

4 Answers  


What is another for creating a task without using taskspawn?

2 Answers  


what are the various methods to overcome it?

2 Answers   Vector India,


hi this is srikanth i need video classes for Vxworks any body having this forward me thanking u

1 Answers   DELL, Wipro,






Assume there is a global variable & a static global variable.Both gets memory allocated from the data segment. Then how does the visiblity of static global varible gets limited to the file alone (in which it gets declared) ???

2 Answers   Wipro,


what is task spawn in vxworks ?plz anyone explain me

2 Answers   NAL,


Write a code to connect Hardware interrupt to ISR...?

1 Answers   iNet, Wipro,


what do u mean by Semaphore..when v wil go for using this..explain about hat.what is the difference betw..binary ,,counting and mutex semphores

2 Answers   Bosch,


What is priority inversion?

10 Answers   Juniper Networks,


I have a situation where the programme counter(PC) shows that vxworks msgQreceive function has been called by task A and Q is full, still I am not picking up the messages. There is no other task registered to receive messages from this Q. The sending task B, which is ISR in this case, is getting timedout everytime it tries posting new message in it. A's state is PEND which means I am waiting for some resource to get free but PC shows I have called vxworks msgQReceive and currently at qJobget+0x018 location. There seems to be two causes now(identified by me): either vxworks qjobget task is not able to do semTake or no messages in Q. But Q is full and semTake failure seems unlikely(though I dont have a mechanism to check so). Besides explaining root cause for above, can anyone suggest how to get my task in READY state again? I also tried flushing the Q; on doing this, more messages get posted in Q but A still doesnt pick up any :(

4 Answers  


Categories