A processing method and apparatus of a thread
By having a high-priority thread act as a proxy for a low-priority thread, the priority inversion problem in condition variable scenarios is solved, improving thread execution efficiency, ensuring that low-priority threads can successfully execute the condition of the condition variable, and reducing the waiting time of high-priority threads.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-07-31
- Publication Date
- 2026-06-12
AI Technical Summary
In condition variable scenarios, when a high-priority thread waits for a low-priority thread to meet the condition variable, the CPU resources of the low-priority thread may be preempted by the medium-priority thread, leading to a priority inversion problem. This can cause the high-priority thread to wait longer, reducing execution efficiency.
By putting high-priority threads into a sleep state without removing them from the run queue, and using low-priority threads as their proxies, it ensures that low-priority threads can successfully execute the condition variable, allowing high-priority threads to continue running quickly and preventing medium-priority threads from preempting CPU resources.
This reduces the time high-priority threads spend waiting for condition variables to become true, improves thread execution efficiency, and avoids wasting CPU resources and priority inversion issues.
Smart Images

Figure CN120762824B_ABST