What is priority inversion ? and What is the solution ?

Answers were Sorted based on User's Feedback



What is priority inversion ? and What is the solution ?..

Answer / qint

A high priority thread waits on a low priority thread for
resources for longer time than expected due to a medium
thread preempts the low priority thread.
Solution is Priority inheritance. Increase low priority
threads priority to the level of high priority thread's for
the duration low priority thread requires to get executed
and release the resource

Is This Answer Correct ?    48 Yes 4 No

What is priority inversion ? and What is the solution ?..

Answer / an

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. If some other medium
priority task, one that does not depend on the shared
resource, attempts to run in the interim, it will take
precedence over both the low priority task and the high
priority task.

The solution to this is "Priority Inheritance" and "Priority
Ceiling".

Is This Answer Correct ?    22 Yes 3 No

What is priority inversion ? and What is the solution ?..

Answer / vallari trivedi

Priority inversion is an RTOS issue.
RTOS allows resource sharing among processes and implements priority based scheduling.

according to the priority based scheduler the highest priority process (suppose A) should run first.
But it shares a resouce(a memory buffer, timer..etc) with a
low priority task(suppose B),

So at present task A is in pending state and task B is running.

Meanwhile another task(suppose C) having priority higher than B but lower than A preempts running task B, leads to a situation in which the high priority task remains in the pending state for a longer period of time in-spite of the fact that it is of higher priority.
this situation is know as--priority inversion.

There are two solutions found to this issue, the one being priority inheritance,

In this the low priority task B inherits high priority status from any high priority task pending for the resource and as soon as it inherits high priority it is executed, thus releasing the resource.
and regains its priority level thereafter.


another being the priority ceiling which I will discuss later.

Is This Answer Correct ?    15 Yes 1 No

What is priority inversion ? and What is the solution ?..

Answer / banavathvishnu

priority
Task A----> 3
Task B----> 2
Task C----> 1

If Task A is holding the semaphore and executing and mean
while Task C occurs and if it is waiting for same Semaphore
Task A is holding, Task C has to wait untill Task A is done
with the resources and release semaphore.

Mean while if Task B is occured which doesnot require the
semaphore, then Task A will be in Ready state and Task B
will execute, after Task B is done, control goes to Task A,
till Task A completes its work Task C even though has
highest priority it has to wait for the semaphore to
release.

This is a problem in RTOS and can be resolved using
Priority Inheritance

Is This Answer Correct ?    9 Yes 3 No

What is priority inversion ? and What is the solution ?..

Answer / manesh

PI ARISES when highpriority task is forced to wait for a
indefinate time for a lower priority to execute

SOLUTION: we have to increase the priority of the lower
priority task and we have to use the resource and we have to
release the resource .this will be done by MUTEX SEMAPHORE

Is This Answer Correct ?    3 Yes 8 No

What is priority inversion ? and What is the solution ?..

Answer / milind g.

When low priority thread is service and high priority theas
is keep on waiting.This situation is called priority
inversion.because even though thread have high priority it
is not executed.

solution:There are different solution one of them is
priority inheritance,It means change the priority of the
thread.make high priority thread to low and lower priority
thread to high.
In this way only the rule high priority should execute first
is follow.

Is This Answer Correct ?    11 Yes 24 No

Post New Answer

More RTOS AllOther Interview Questions

What is the state of the processor, when a process is waiting for some event to occur?

14 Answers   MTS,


What is priority inversion ? and What is the solution ?

6 Answers   Qualcomm, Tandberg, Wipro,


I have been working on one thread which manage and control a couple of circular buffers. It has api for other thread to access. As the thread grows bigger and bigger, I split it as 3 to 4 threads which need to share common buffers, and also their api could be used by other threads, (not these three threads). Inside api, I also allow other threads to access these three threads' common buffers(more than one buffer). SO I have to use mutex to avoid race condition . But I found mutex will be everwhere in all the threads when they update the common buffer. I am wondering whether I could reduce mutex usage(more mutex will hure my system performance). any ideas for how to reduce mutex usage meanwhile to avoid race condition. Thanks

2 Answers  


What is the difference b/n any GPOS and RTOS?Give suitable examples or characteristic of RTOS to support your answer. What changes can be done in a GPOS to make it work like a RTOS? What basic features will you support, if you have to design a RTOS?

8 Answers   Bosch, Emulogic, L&T, Qualcomm,


What is a mission critical system ?

3 Answers  






what is major concerns about any RTOS selection ?

4 Answers   Bosch,


What is a Real-Time System ?

5 Answers  


what is difference between IRQ and FRQ ?

4 Answers   Bosch,


What do you mean by deadlock?

8 Answers   Bosch,


what is the need of creating 4GB of pages in linux?

1 Answers   TCS,


Explain the difference between microkernel and macro kernel.

5 Answers   Infosys, Tech Mahindra,


Give an example of microkernel.

13 Answers   Global Edge, Samsung,


Categories