This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Priority inheritance with short wait timeout

For how long does a low priority task run at the higher priority when priority inheritance comes into play?

os_mut_wait(0xFFFE); If a high priority task is waiting a long time I would expect the low priority task to run at high priority until the resource is released.

os_mut_wait(mutex, 1); If the high priority task is configured to wait a short time does the low priority task revert to its low priority after that time?

os_mut_wait(mutex, 0); In particular if the timeout is 0, does priority inheritance come into effect at all?

Parents
  • From examining the Source code (CMSIS 5.3.0 RTOS).

    1) os_mut_wait(0xFFFE); If a high priority task is waiting a long time I would expect the low priority task to run at high priority until the resource is released

    Low Priority task runs at the higher level until it releases the mutex.

    2) os_mut_wait(mutex, 1); If the high priority task is configured to wait a short time does the low priority task revert to its low priority after that time?

    Low Priority task runs at the higher level until it releases the mutex, even if the higher priority task timed out on the mutex wait. (Good catch)

    3) os_mut_wait(mutex, 0); In particular if the timeout is 0, does priority inheritance come into effect at all?

    The Low Priority task is not bumped up on a wait of 0.

    I looked quickly at the RTOS2 and I believe it behaves the same, but since I don't use that I don't really care enough to take the time to be sure.

Reply
  • From examining the Source code (CMSIS 5.3.0 RTOS).

    1) os_mut_wait(0xFFFE); If a high priority task is waiting a long time I would expect the low priority task to run at high priority until the resource is released

    Low Priority task runs at the higher level until it releases the mutex.

    2) os_mut_wait(mutex, 1); If the high priority task is configured to wait a short time does the low priority task revert to its low priority after that time?

    Low Priority task runs at the higher level until it releases the mutex, even if the higher priority task timed out on the mutex wait. (Good catch)

    3) os_mut_wait(mutex, 0); In particular if the timeout is 0, does priority inheritance come into effect at all?

    The Low Priority task is not bumped up on a wait of 0.

    I looked quickly at the RTOS2 and I believe it behaves the same, but since I don't use that I don't really care enough to take the time to be sure.

Children