Dynamic Thread Allocation via Runtime Buffer

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for automatically controlling run-time parallelization of software applications on multi-core processors are inefficient, particularly in over-subscribed systems, as they often require costly system queries to determine the optimal number of threads, leading to performance limitations.

Innovation Solution

A system and method that utilize a buffer to store demand information and allocation information, allowing the software application or runtime library to dynamically adjust the number of threads for parallel execution, bypassing expensive system calls by using asynchronous load and store instructions, and a supervising entity to compute and store allocation information for later access.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If the application queries the operating system to determine the optimal number of threads, then the thread count can be optimized for performance, but the execution time increases due to costly system calls

Engineering Contradiction:
Improveexecution efficiencyVSAvoidtime for system queries
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The runtime library performs preliminary actions by pre-computing thread allocation decisions and caching them in a buffer before the parallel region executes. The supervising entity prepares allocation information in advance based on demand information stored in the buffer, eliminating the need for costly real-time OS queries during parallel execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

A buffer acts as an intermediary between the application and the operating system. The buffer stores demand information from the application and allocation information from the supervising entity, mediating communication and eliminating direct system calls during parallel region execution.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If gang scheduling is used to schedule all threads as a single group, then performance is improved on multi-core systems, but the system becomes over-subscribed when there are more ready threads than available hardware threads

Engineering Contradiction:
Improveperformance on multi-coreVSAvoidflexibility in thread allocation
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The system dynamically adjusts the number of threads allocated to a parallel region based on real-time conditions. The runtime library can modify the thread count dynamically by updating allocation information in the buffer, allowing the system to adapt between gang scheduling (for performance) and flexible thread allocation (for system resource management).

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS8528001B2Controlling and dynamically varying automatic parallelization
Publication Date: 2013.09.03 ORACLE AMERICAN INC
  • US8528001B2 patent drawing
  • US8528001B2 patent drawing
  • US8528001B2 patent drawing

AI summary

A system and method for automatically controlling run-time parallelization of a software application. A buffer is allocated during execution of program code of an application. When a point in program code near a parallelized region is reached, demand information is stored in the buffer in response to reaching a predetermined first checkpoint. Subsequently, the demand information is read from the buffer in response to reaching a predetermined second checkpoint. Allocation information corresponding to the read demand information is computed and stored the in the buffer for the application to later access. The allocation information is read from the buffer in response to reaching a predetermined third checkpoint, and the parallelized region of code is executed in a manner corresponding to the allocation information.