Simple Priority Inheritance for Embedded Task Scheduling
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing multi-tasking methods in embedded systems face challenges with priority inversion, where higher-priority tasks are delayed due to lower-priority tasks holding mutex locks, leading to increased system overhead and disruption of real-time characteristics, as seen in both Basic Priority Inversion and Immediate Inheritance Protocol schemes.
Innovation Solution
The proposed method, Simple Priority Inheritance, determines if a resource is held by a lower-priority task and increases the priority of that task to the highest priority only when priority inversion occurs, allowing the higher-priority task to proceed, thus avoiding unnecessary priority inheritance and blocking.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If priority inheritance is applied to prevent priority inversion, then real-time characteristics are improved, but system overhead increases due to frequent priority changes and task blocking
Solution Approach 1:
The patent applies priority inheritance locally and selectively rather than globally. When a high-priority task is blocked by a low-priority task holding a mutex, only the specific low-priority task holding the mutex has its priority temporarily increased. This localized approach prevents unnecessary priority changes in other tasks, reducing system overhead while maintaining real-time characteristics for affected tasks.
Solution Approach 2:
The patent dynamically adjusts task priorities based on real-time blocking conditions. The priority of a low-priority task is temporarily increased only when it is actually blocking a high-priority task, and restored afterward. This dynamic adjustment avoids static priority assignment problems and reduces unnecessary context switches and scheduling overhead compared to always maintaining highest priority inheritance.
2Reliability
If immediate priority inheritance is applied, then priority inversion is eliminated, but task blocking increases due to unnecessary priority increases
Solution Approach 1:
The patent implements selective priority inheritance where only the specific task holding a mutex that blocks a high-priority task has its priority increased. This contrasts with immediate priority inheritance that would increase priorities more broadly. The localized application eliminates priority inversion only where necessary, avoiding unnecessary task blocking and context switches in other parts of the system.
3Device complexity
If basic priority inversion scheme is used, then system overhead is reduced, but real-time characteristics deteriorate due to priority inversion
Solution Approach 1:
The patent applies partial priority inheritance by increasing the priority of only the specific task holding the blocking mutex, rather than implementing full priority inheritance across all tasks. This partial action is sufficient to eliminate priority inversion for the affected high-priority task while minimizing system overhead and avoiding the excessive complexity of comprehensive priority inheritance schemes.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
Provided are a multi-tasking method of performing a plurality of tasks according to priority of each of the plurality of tasks, and an embedded system therefor. It is determined whether a resource that is to be used by a current task is being used by another task, a priority of the current task is compared to a priority of the task that is using the resource according to a result of the determination, and according to a result of the comparison, the priority of the task that is using the resource is increased to a highest priority of priorities of all tasks trying to occupy a CPU. Accordingly, conventional problems in the BPI and IIP schemes can be solved.