Thread Scheduling via Pusher List for Priority Inversion
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Priority inversions in thread scheduling lead to reduced processing performance, as higher priority threads are blocked waiting for resources held by lower priority threads, and existing solutions either do nothing or temporarily adjust priorities without restoring the original priority levels or addressing timely processing of other threads.
Innovation Solution
Implementing a pusher list mechanism that allows higher priority threads waiting on resources to temporarily assume the scheduling state of the resource-holding thread, enabling direct context-switching and CPU usage charging, while maintaining a list of waiting threads ordered by priority to efficiently manage resource access and release.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Device complexity
If the scheduler does nothing to resolve priority inversion, then the system maintains simple scheduling logic, but higher priority threads are blocked and processing performance deteriorates
Solution Approach 1:
The patent introduces a pusher list as an intermediary data structure that mediates between resource-holding threads and waiting threads. When a thread releases a resource, the pusher list mechanism automatically identifies and promotes waiting threads based on their priority, resolving the priority inversion without complex scheduler intervention while maintaining simple scheduling logic.
Solution Approach 2:
The patent performs preliminary actions by maintaining a pusher list of waiting threads in advance. When a resource becomes available, the system has already identified which threads should be promoted, eliminating the need for complex real-time scheduling decisions and improving processing performance while keeping the scheduling logic relatively simple.
2Productivity
If the scheduler temporarily adjusts thread priorities to resolve priority inversion, then higher priority threads can be processed promptly, but the original priority levels are not restored and other threads experience delays
Solution Approach 1:
The patent dynamically changes the scheduling state parameters of threads by adding them to a pusher list when resources are released. This allows temporary priority adjustment to resolve priority inversion, and the system automatically restores original priority levels after processing, preventing delays to other threads while maintaining high processing speed for critical threads.
Solution Approach 2:
The patent implements dynamic thread scheduling by allowing threads to transition between different scheduling states (regular running, pushed to front of run queue, waiting). This dynamic adjustment enables the system to respond to priority inversions in real-time while automatically returning to normal scheduling behavior, balancing processing speed with fairness to other threads.
3Productivity
If the scheduler uses many variables to determine thread priority, then scheduling decisions can be optimized, but the complexity of managing and updating these variables increases
Solution Approach 1:
The patent extracts the complex priority management logic from the main scheduler by implementing a separate pusher list mechanism. This isolation allows the scheduler to use multiple variables for comprehensive scheduling optimization without burdening the core scheduling logic, as the pusher list handles the complex variable management independently.
4Reliability
If the scheduler blocks waiting threads and removes them from the run queue, then resource access control is maintained, but the blocked threads cannot be promptly processed when resources become available
Solution Approach 1:
The patent replaces the traditional mechanical blocking mechanism with a pusher list-based notification system. Instead of completely blocking threads from the run queue, the system maintains thread references in the pusher list and automatically promotes them when resources are released. This substitution maintains resource access control through the mutex mechanism while dramatically improving thread resumption speed by eliminating the need to requeue and rescan for waiting threads.
Data Source
AI summary
Disclosed herein are systems, methods, and computer-readable media directed to scheduling threads in a multi-processing environment that can resolve a priority inversion. Each thread has a scheduling state and a context. A scheduling state can include attributes such as a processing priority, classification (background, fixed priority, real-time), a quantum, scheduler decay, and a list of threads that may be waiting on the thread to make progress. A thread context can include registers, stack, other variables, and one or more mutex flags. A first thread can hold a resource with a mutex, the first thread having a low priority. A second thread having a scheduling state with a high priority can be waiting on the resource and may be blocked behind the mutex held by the first process. A scheduler can execute the context of the lower priority thread using the scheduler state of the second, higher priority thread. More than one thread can be waiting on the resource held by the first thread. A “pusher list” of threads that are waiting on the first thread can be associated with the first thread. The scheduler can use the pusher list to identify threads that need the first thread to make progress until the first thread releases the resource and mutex. Then, the scheduler can use the pusher list to identify threads that are now runnable and make immediate use of the resource.


