Task Priority Processing for Multitask Systems
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In multitask systems, priority inversion occurs when a high-priority task is blocked by lower-priority tasks sharing a critical section, leading to delayed execution and poor real-time performance, as conventional priority inheritance methods fail to prevent low-priority tasks from interrupting higher-priority tasks.
Innovation Solution
A task priority processing method that raises the priority of a second task accessing a critical section when blocked, and also raises the priority of a third task sharing a second critical section with the second task, ensuring that high-priority tasks are not delayed by low-priority tasks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If priority inheritance method is applied to raise the priority of task2 when task1 is blocked, then task1 can be ensured to execute smoothly after task2, but low-priority task3 can still interrupt and delay high-priority task1 execution
Solution Approach 1:
The system performs preliminary action by raising the priority of task3 before task2 releases the mutex. When task1 is blocked by task2, the system proactively identifies that task3 holds the mutex and raises task3's priority to prevent it from interrupting task1 later. This preliminary priority adjustment eliminates the potential interruption before it occurs.
Solution Approach 2:
The system introduces an intermediary mechanism that monitors mutex ownership and automatically adjusts priorities based on the mutex holder's identity. When task2 holds the mutex and blocks task1, the system intermediates by detecting task3's mutex ownership and raising its priority, thereby mediating between task1's high priority requirement and task3's current execution state.
2Reliability
If conventional priority inheritance is used, then task2's priority is raised when blocking task1, but the system complexity increases due to additional priority management logic
Solution Approach 1:
The system implements feedback by continuously monitoring which task holds the mutex and automatically adjusting priorities based on this feedback. When task2 blocks task1, the system feedbacks by detecting task3's mutex ownership and raising its priority accordingly. This closed-loop feedback mechanism prevents priority inversion automatically without requiring complex manual intervention.
Solution Approach 2:
The system performs self-service by automatically detecting mutex ownership and adjusting priorities without external intervention. The kernel monitors mutex state and autonomously raises the priority of the task holding the mutex when it blocks a high-priority task, eliminating the need for complex external priority management logic.
Data Source
AI summary
In a multitask computing system, there are multiple tasks include a first task, a second task, and a third task, and the first task has a higher priority than that of the second task and the third task. A method including raising the priority of the second task that shares a first critical section with the first task and is accessing the first critical section when the first task is blocked due to failure to access the first critical section; determining whether there is a third task that shares a second critical section with the second task and is accessing the second critical section; and raising, when the third task is present, the priority of the third task. The techniques of the present disclosure prevent a low-priority third task from delaying the execution of a second task, thus avoiding the priority inversion caused by the delayed execution of a high-priority first task.


