Monitoring Thread Detects Worker Thread Hangs via Stack Comparison

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Multi-threaded applications face challenges in detecting and addressing hang states of worker threads caused by non-callable external component APIs, leading to unresponsive conditions and requiring manual intervention or disruptive restarts, which can disrupt services and fail to identify root causes effectively.

Innovation Solution

A monitoring thread is implemented to compare function call stacks of worker threads, identify non-callable APIs, and automatically terminate hung threads, maintaining performance by using an API state map to prevent further invocations of faulty APIs and differentiate between hung and slow threads.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual intervention or disruptive restarts are used to address hung worker threads, then system reliability is improved, but service continuity deteriorates and root cause identification remains ineffective

Engineering Contradiction:
Improvesystem reliabilityVSAvoidservice continuity
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The monitoring thread performs preliminary detection of hung worker threads by comparing function call stacks before the hang condition propagates through the system. This early detection allows the system to identify and terminate problematic threads proactively, preventing service disruption while maintaining reliability.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The monitoring thread acts as an intermediary between worker threads and the main application process. It continuously observes worker thread states through function call stack comparison and intervenes by terminating hung threads, thereby resolving the contradiction between maintaining reliability and ensuring service continuity without requiring disruptive restarts.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If function call stack comparison is performed continuously to detect hung threads, then detection precision is improved, but system overhead increases

Engineering Contradiction:
Improvedetection precisionVSAvoidsystem overhead
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The monitoring thread performs function call stack comparison at periodic intervals rather than continuously. This periodic detection approach maintains sufficient precision for identifying hung threads while reducing the system overhead and resource consumption associated with constant monitoring.

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

The monitoring thread utilizes the existing function call stack data structure that is already maintained by the worker threads for execution tracking. By leveraging this pre-existing data, the monitoring mechanism achieves accurate detection without requiring additional specialized data structures or excessive computational resources.

Inventive Principle:
Principle #25Self-service

3Productivity

If worker threads are terminated automatically upon hang detection, then productivity is improved, but system complexity increases

Engineering Contradiction:
ImproveproductivityVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system implements self-service automation where the monitoring thread automatically detects hung worker threads through function call stack comparison and terminates them without requiring external intervention. This automated remediation process improves productivity by preventing thread exhaustion while managing system complexity through a standardized, self-managing approach.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The monitoring thread establishes a feedback loop that continuously monitors worker thread states and automatically triggers termination when hang conditions are detected. This closed-loop control mechanism improves productivity by preventing system degradation while managing complexity through systematic, rule-based automation rather than ad-hoc interventions.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11693739B2Hang detection and remediation in a multi-threaded application process
Publication Date: 2023.07.04 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US11693739B2 patent drawing
  • US11693739B2 patent drawing
  • US11693739B2 patent drawing

AI summary

Detecting non-callable external component APIs is provided. It is determined whether a first function call stack of a worker thread in a multi-threaded application of the computer matches a second function call stack of the worker thread. In response to determining that the first function call stack matches the second function call stack of the worker thread, an external component application programming interface (API) corresponding to the worker thread is identified from a function call stack of the worker thread. The external component API corresponding to the worker thread is marked as non-callable in an API state map. The worker thread is marked as being in a hang state. The worker thread in the hang state is terminated as a remediation action step to maintain performance.