PThread Priority Inheritance #999
-
What is the significance of the PThread priority inheritance feature in F Prime? Can I just remove a few lines of code and reasonably expect that things will work ok in a lightly loaded system? For reference, I am looking into the problem that was mentioned on the Google Groups a while ago: https://groups.google.com/g/fprime-community/c/ynOrgwfApAE Thanks, Sterling Peet |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Priority inheritance solves a particular deadlock problem in RTOSes, priority inversion: https://en.wikipedia.org/wiki/Priority_inversion If a low-priority task is holding a mutex in a priority inversion condition, it will temporarily raise the priority of of the lower priority task to free up the higher priority task. It will only do this if the mutex has that attribute enabled, which is why we always enable it in our code. In "regular" Linux userspace, the tasks are round-robined so one task can't hold the resource forever. Are you thinking of removing the setting to solve a particular problem? |
Beta Was this translation helpful? Give feedback.
Priority inheritance solves a particular deadlock problem in RTOSes, priority inversion:
https://en.wikipedia.org/wiki/Priority_inversion
If a low-priority task is holding a mutex in a priority inversion condition, it will temporarily raise the priority of of the lower priority task to free up the higher priority task. It will only do this if the mutex has that attribute enabled, which is why we always enable it in our code. In "regular" Linux userspace, the tasks are round-robined so one task can't hold the resource forever.
Are you thinking of removing the setting to solve a particular problem?