Dynamic Thread Priority Management in OS Concurrency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing operating systems managing multiple threads face challenges with fixed priority worker threads, limited priority levels due to resource constraints, and the risk of priority inversions and dependency deadlocks, especially when handling CPU-intensive operations.

Innovation Solution

An operating system with a concurrency controller that dynamically manages multiple pools of worker threads with prioritized queues, allowing threads to change priority mid-operation and preempting lower priority threads to ensure efficient resource allocation and prevent priority inversions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If worker threads have fixed priority levels with separate pools for each priority, then priority inversion risk is reduced, but the number of priority levels is limited by system resources

Engineering Contradiction:
Improvepriority inversion preventionVSAvoidnumber of priority levels
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent implements dynamic priority assignment where worker threads can change their priority level during execution rather than being fixed. The system allows threads to be promoted or demoted based on the priority of tasks they are executing, enabling flexible adaptation to different workload requirements without being constrained by a fixed number of priority pools.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent creates a universal worker thread pool that can serve multiple priority levels through dynamic assignment rather than requiring separate dedicated pools for each priority. A single pool of worker threads can be dynamically assigned to different priority queues based on current system state and task requirements, making the system more versatile with limited resources.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Productivity

If separate queues are used for each priority level with dedicated worker threads, then request prioritization is achieved, but system resource consumption increases

Engineering Contradiction:
Improverequest prioritization efficiencyVSAvoidsystem resources
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent merges multiple priority-specific worker thread pools into a single unified pool. Instead of having separate dedicated threads for each priority level, the system combines all worker threads into one pool and uses a scheduler to dynamically assign them to different priority queues based on current workload and priority requirements, reducing overall resource consumption.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The system dynamically assigns worker threads from the unified pool to different priority queues based on real-time system state. When high-priority tasks arrive, worker threads are dynamically allocated to those queues; when low-priority, threads can be reallocated. This dynamic assignment maintains prioritization efficiency while optimizing resource utilization.

Inventive Principle:
Principle #15Dynamics

3Quantity of substance

If a single pool of worker threads is used for all priority levels, then resource utilization improves, but priority inversion risk increases

Engineering Contradiction:
Improveresource utilizationVSAvoidpriority inversion prevention
Core Design Contradiction:
Quantity of substanceVSReliability

Solution Approach 1:

The patent introduces a scheduler as an intermediary between the unified worker thread pool and the priority queues. The scheduler acts as a mediator that manages thread assignment and preemption, ensuring that high-priority tasks can preempt low-priority tasks even when using a single shared pool. This intermediary mechanism prevents priority inversion while maintaining efficient resource utilization through the unified pool.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs preliminary actions by establishing preemption rules and priority protocols before priority inversions can occur. The scheduler continuously monitors queue priorities and proactively preempts lower-priority threads when higher-priority tasks arrive, preventing priority inversion issues before they manifest in system behavior.

Inventive Principle:
Principle #10Preliminary action

4Reliability

If worker threads cannot change priority during execution, then priority inversion is prevented, but system responsiveness to changing requirements decreases

Engineering Contradiction:
Improvepriority inversion preventionVSAvoidthread priority flexibility
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent implements dynamic priority change capability for worker threads during execution. Threads can be promoted or demoted based on the priority of tasks they are executing or system conditions, allowing the system to adapt to changing requirements while the scheduler ensures priority inversion prevention through controlled transition mechanisms and preemption protocols.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentEP3008594B1Assigning and scheduling threads for multiple prioritized queues
Publication Date: 2019.09.04 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP3008594B1 patent drawingFigure 1
  • EP3008594B1 patent drawingFigure 2
  • EP3008594B1 patent drawingFigure 3

AI summary

An operating system provides a pool of worker threads servicing multiple queues of requests at different priority levels. A concurrency controller limits the number of currently executing threads. The system tracks the number of currently executing threads above each priority level, and preempts operations of lower priority worker threads in favor of higher priority worker threads. A system can have multiple pools of worker threads, with each pool having its own priority queues and concurrency controller. A thread also can change its priority mid-operation. If a thread becomes lower priority and is currently active, then steps are taken to ensure priority inversion does not occur. In particular, the current thread for the now lower priority item can be preempted by a thread for a higher priority item and the preempted item is placed in the lower priority queue.