Alternatives
- Priority ceiling promotion
- A combination of priority inheritance and priority ceiling can be used.
How is prio ceiling promotion different from prio inheritance?
Priority Inheritance: When a higher priority task starts waiting on a mutex captured by a lower priority task, the priority of the lower priority task is temporarily boosted to that of the higher priority task. This enables the lower priority task to continue to run even when preempted by a medium priority task.
Disadvantages:
a. The wait period of medium-prio tasks for a promoted low prio task cannot be easily determined if the prio inheritance of low priority is based on several random sequence of events.
b. If the promoted task waits for another mutex held by another task , then this task's priority must also be promoted. This is called priority propagation. System behaviour becomes difficult to determine.
c. Again if an even higher priority task now starts waiting for this promoted low prio task, the promoted low prio task must be promoted again and also propagated again making the system behaviour even more tougher to determine.
Priority Ceiling Promotion: A priority ceiling is specified for every mutex when created. This is equal to the priority of the highest priority task that can take the mutex. When a low prio task takes this mutex it's prio is immediately boosted to the ceiling. Hence a mid prio task cannot preempt this task as long as it owns the mutex.
Disadvantage:
a. If a low prio task frequently uses the mutex and a high prio task seldomly, then unnecessarily a mid-prio task will be disallowed from preempting the low- prio task.