Runtime Thread Pool Management for Heterogeneous Applications

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Managing thread pools for multiple applications in a runtime environment is challenging due to the need for balancing the number of threads, as too few threads lead to underutilization and too many threads cause memory overwork, with existing solutions being inefficient when multiple applications redundantly manage resources.

Innovation Solution

Implementing a Transparent Thread Pool Manager (TTPM) within the runtime environment to dynamically manage thread pool sizes by monitoring workloads and using contextual functions for thread creation and termination, including the use of entry and exit lambdas to adjust thread counts and store thread state for efficient recreation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If each application independently manages its own thread pool, then each application can optimize its thread usage, but redundant resource management occurs across multiple applications

Engineering Contradiction:
Improvethread utilization efficiencyVSAvoidresource management complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent merges thread pool management from multiple independent applications into a single shared thread pool managed by a runtime environment. Instead of each application maintaining separate thread pools, the runtime environment creates one unified thread pool that serves all applications, eliminating redundant thread creation and management overhead while improving overall resource utilization efficiency

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The shared thread pool is designed to be universal, serving multiple heterogeneous applications simultaneously. The runtime environment manages this single thread pool to execute tasks from different applications, making the thread pool multi-functional and applicable across diverse workloads rather than being application-specific

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

2Speed

If the thread pool size is increased to handle peak workload, then task completion speed improves, but memory consumption increases

Engineering Contradiction:
Improvetask execution speedVSAvoidmemory consumption
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The thread pool size is made dynamic rather than static. The runtime environment continuously monitors workload conditions and adjusts the number of threads in the pool accordingly. When workload increases, threads are created to improve execution speed; when workload decreases, threads are terminated to reduce memory consumption. This dynamic adaptation resolves the contradiction between speed and memory usage

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system implements feedback mechanisms where the runtime environment monitors task queue depth and thread utilization metrics. Based on this feedback, the system automatically adjusts thread pool size - creating threads when the queue is deep and terminating threads when the queue is shallow - thereby balancing execution speed requirements against memory consumption constraints

Inventive Principle:
Principle #23Feedback

3Productivity

If threads are frequently created and terminated to adapt to workload changes, then resource utilization optimizes, but processor power is wasted on thread recreation

Engineering Contradiction:
Improveresource utilization efficiencyVSAvoidprocessor power for thread management
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

The system performs preliminary actions by maintaining a pool of idle threads that are pre-created and kept ready to execute tasks. Instead of creating threads from scratch when needed, the runtime environment maintains threads in a suspended state that can be quickly activated. This preliminary preparation reduces the frequency and cost of thread creation operations

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

Instead of completely terminating threads during low workload periods, the system discards active tasks but recovers the thread infrastructure by returning threads to an idle state. The threads are not fully destroyed but rather put into a low-power waiting state, allowing rapid reuse when workload increases without the overhead of complete recreation

Inventive Principle:
Principle #34Discarding and recovering

Data Source

PatentUS11340955B2Thread pool management for multiple applications
Publication Date: 2022.05.24 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US11340955B2 patent drawing
  • US11340955B2 patent drawing
  • US11340955B2 patent drawing

AI summary

Execution of varying tasks for heterogeneous applications running in a single runtime environment is managed. The runtime environment is capable of managing thread pools for any of the plurality of applications and receives a request to manage a thread pool for one of the applications. The request includes size thresholds for the pool, a first function to be invoked for creation of threads, and a second function to be invoked for termination of the threads. Responsive to detecting that a first size threshold is not satisfied, the runtime environment invokes the first function to cause the application to create an additional thread. Responsive to detecting that a second size threshold is not satisfied, the runtime environment places an artificial task that incorporates the second function into a work queue for the thread pool, whereby a thread executes the artificial task to invoke the second function and thereby terminates.