priority inversion - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

priority inversion

I have 2 questions.

1) what is priority inversion ?

2)In which cases it will happen?

Comments

  • crakoczycrakoczy Posts: 1Member
    : I have 2 questions.
    :
    : 1) what is priority inversion ?
    :
    : 2)In which cases it will happen?
    :
    :
    Check the Wikipedia online free encyclopedia. I just found some great info about embedded systems there.

    http://en.wikipedia.org/wiki/Priority_inversion
  • dssuresh6dssuresh6 Posts: 17Member
    : : I have 2 questions.
    : :
    : : 1) what is priority inversion ?
    : :
    : : 2)In which cases it will happen?
    : :
    : :
    : Check the Wikipedia online free encyclopedia. I just found some great info about embedded systems there.
    :
    : http://en.wikipedia.org/wiki/Priority_inversion
    :

    ------

    I had already seen the website and didn't understand anything from that.That's why I put this question here. What the website says is,when a low-priority task (say, A)holds a shared resource, it'll make a high-priority task (say, B) which needs the resource, wait for the resource. This is priority inversion. At the same time, it allows a medium-prority task(say, C) which needs the shared resource, access it. Compared to A, C is at a higher-priority (even though it is at lower-priority than B). Then how does A allows C(a high-priority task compared to A) to access the shared resource whereas it doesn't allow another high-priority task B to access the same shared resource?
  • joshcjoshc Posts: 2Member
    : : : I have 2 questions.
    : : :
    : : : 1) what is priority inversion ?
    : : :
    : : : 2)In which cases it will happen?
    : : :
    : : :
    : : Check the Wikipedia online free encyclopedia. I just found some great info about embedded systems there.
    : :
    : : http://en.wikipedia.org/wiki/Priority_inversion
    : :
    :
    : ------
    :
    : I had already seen the website and didn't understand anything from that.That's why I put this question here. What the website says is,when a low-priority task (say, A)holds a shared resource, it'll make a high-priority task (say, B) which needs the resource, wait for the resource. This is priority inversion. At the same time, it allows a medium-prority task(say, C) which needs the shared resource, access it. Compared to A, C is at a higher-priority (even though it is at lower-priority than B). Then how does A allows C(a high-priority task compared to A) to access the shared resource whereas it doesn't allow another high-priority task B to access the same shared resource?
    :

    Hi,

    Let me try and clarify what priority inversion is. Let's say you have three tasks: A, B, and C. A has high priority, B has medium priority, and C has low priority. Now let's say that there is a shared resource that task A and task C both use at some point. Now consider the following:

    Task C is running and enters a critical section and acquires the shared resource. At this point none of the higher priority tasks, A and B, are ready to run, i.e. they may be waiting on some I/O etc so they are not in the READY state.

    Now Task B enters the READY state so task B will preempt task C because it has higher priority than C. Task B does not need the shared resource so it can be put in the RUN state.

    Now sometime later Task A is READY but it can't be put in the RUN state because Task C has a lock on the shared resource. Task B is currently running so Task C can't exit the critical section because it has a lower priority than B and won't be put in the RUN state.

    What is happening is that Task A is READY but Task B is RUNNING even though Task A has higher priority than Task B. Thus to avoid priority inversion there has to be some sort of scheme to address these situations. There are various protocols to take care of this such as highest-locker, priority ceiling, etc.

  • sandyARMsandyARM Posts: 9Member
    : : : : I have 2 questions.
    : : : :
    : : : : 1) what is priority inversion ?
    : : : :
    : : : : 2)In which cases it will happen?
    : : : :
    : : : :
    : : : Check the Wikipedia online free encyclopedia. I just found some great info about embedded systems there.
    : : :
    : : : http://en.wikipedia.org/wiki/Priority_inversion
    : : :
    : :
    : : ------
    : :
    : : I had already seen the website and didn't understand anything from that.That's why I put this question here. What the website says is,when a low-priority task (say, A)holds a shared resource, it'll make a high-priority task (say, B) which needs the resource, wait for the resource. This is priority inversion. At the same time, it allows a medium-prority task(say, C) which needs the shared resource, access it. Compared to A, C is at a higher-priority (even though it is at lower-priority than B). Then how does A allows C(a high-priority task compared to A) to access the shared resource whereas it doesn't allow another high-priority task B to access the same shared resource?
    : :
    :
    : Hi,
    :
    : Let me try and clarify what priority inversion is. Let's say you have three tasks: A, B, and C. A has high priority, B has medium priority, and C has low priority. Now let's say that there is a shared resource that task A and task C both use at some point. Now consider the following:
    :
    : Task C is running and enters a critical section and acquires the shared resource. At this point none of the higher priority tasks, A and B, are ready to run, i.e. they may be waiting on some I/O etc so they are not in the READY state.
    :
    : Now Task B enters the READY state so task B will preempt task C because it has higher priority than C. Task B does not need the shared resource so it can be put in the RUN state.
    :
    : Now sometime later Task A is READY but it can't be put in the RUN state because Task C has a lock on the shared resource. Task B is currently running so Task C can't exit the critical section because it has a lower priority than B and won't be put in the RUN state.
    :
    : What is happening is that Task A is READY but Task B is RUNNING even though Task A has higher priority than Task B. Thus to avoid priority inversion there has to be some sort of scheme to address these situations. There are various protocols to take care of this such as highest-locker, priority ceiling, etc.
    :
    :

    Thanks JoshC,
    good example. :)
    Can you please extent it to the solutoins 1. priority ceiling 2. highest-locker etc.
    it would be complete.

Sign In or Register to comment.