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 a mission critical system ?

3 Answers  


what are the rules u follow when u r writing critical section of code?

6 Answers   TCS,


What do you mean by deadlock?

8 Answers   Bosch,


What is the difference between Hard and Soft real-time systems ?

11 Answers   Google, Hella, Satyam,


Describe different job scheduling in operating systems.

9 Answers  






When would you choose top down methodology?

3 Answers   CTS,


What is priority inversion ? and What is the solution ?

6 Answers   Qualcomm, Tandberg, Wipro,


what is major concerns about any RTOS selection ?

4 Answers   Bosch,


Explain the difference between microkernel and macro kernel.

5 Answers   Infosys, Tech Mahindra,


Write a small dc shell script to find number of FF in the design

0 Answers  


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

1 Answers   TCS,


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

14 Answers   MTS,


Categories