Thread Scheduling via Global and Group Run Queues

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional operating system scheduling algorithms often lead to thread starvation, where processes with lower priority threads are unfairly delayed due to higher priority threads dominating processor time, resulting in inefficient resource utilization and potential software decay.

Innovation Solution

Implementing a multi-process level scheduling mechanism using a global run queue and multiple group run queues, where threads are prioritized based on both process and thread priority, and resource usage monitoring adjusts process priorities to balance resource allocation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If conventional scheduling algorithms prioritize higher priority threads, then throughput and response time are improved, but lower priority threads experience starvation and fairness deteriorates

Engineering Contradiction:
ImprovethroughputVSAvoidfairness
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The scheduling system segments threads into different priority levels using multiple run queues (e.g., high priority queue, normal priority queue, low priority queue). The scheduler selectively services these queues based on system state, allowing high priority threads to be executed first when resources are available, while ensuring low priority threads are not completely starved by periodically servicing lower priority queues or using aging mechanisms.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The scheduler implements periodic action by cyclically servicing different priority queues. Instead of always selecting from the highest priority queue, the scheduler periodically switches to service lower priority queues, ensuring that all threads eventually receive CPU time. This periodic servicing prevents permanent starvation of lower priority threads while maintaining the responsiveness of high priority threads.

Inventive Principle:
Principle #19Periodic action

2Speed

If the scheduler always selects highest priority threads, then response time is improved, but waiting time for lower priority threads increases significantly

Engineering Contradiction:
Improveresponse timeVSAvoidwaiting time
Core Design Contradiction:
SpeedVSLoss of time

Solution Approach 1:

The scheduler dynamically adjusts its behavior based on system conditions and thread characteristics. It uses dynamic priority adjustment mechanisms where thread priorities can change over time based on factors such as aging (threads waiting longer gain priority), resource availability, and system load. This dynamic approach allows the scheduler to respond to changing conditions and balance response time with fairness.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The scheduler changes parameters such as thread priority values and queue selection criteria based on system state. By modifying priority parameters dynamically (e.g., increasing priority of waiting threads after a certain time threshold), the system can adjust the balance between response time and waiting time without requiring complete restructuring of the scheduling algorithm.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If multiple threads from the same process are enqueued, then productivity is improved, but resource allocation fairness between processes deteriorates

Engineering Contradiction:
Improveexecution efficiencyVSAvoidresource allocation fairness
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The scheduler introduces an intermediary mechanism (such as process-level scheduling layers or thread group management) that mediates between individual thread requests and CPU allocation. This intermediary ensures that multiple threads from the same process are managed fairly by implementing process scheduling policies that prevent any single process from monopolizing CPU resources, while still allowing efficient execution of ready threads within each process.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20190155656A1Method and system for scheduling threads for execution
Publication Date: 2019.05.23 APPLE INC
  • US20190155656A1 patent drawing
  • US20190155656A1 patent drawing
  • US20190155656A1 patent drawing

AI summary

Techniques for scheduling threads for execution in a data processing system are described herein. According to one embodiment, in response to a request for executing a thread, a scheduler of an operating system of the data processing system accesses a global run queue to identify a global run entry associated with the highest process priority. The global run queue includes multiple global run entries, each corresponding to one of a plurality of process priorities. A group run queue is identified based on the global run entry, where the group run queue includes multiple threads associated with one of the processes. The scheduler dispatches one of the threads that has the highest thread priority amongst the threads in the group run queue to one of the processor cores of the data processing system for execution.