Thread Management for Race Condition Prevention in Program Replay

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current software development processes face challenges in efficiently identifying and reproducing bugs during testing and debugging, particularly due to issues with timing, non-determinism, and platform compatibility in program execution recording and replaying systems.

Innovation Solution

A method and apparatus for recording and replaying computer programs that manage threads to prevent race conditions by establishing a single application lock, intercepting memory operations, and using exception handlers to synchronize state, allowing for accurate reproduction of bugs across different hardware configurations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of manufacture

If external I/O recorders are used to simulate external input, then robustness in response to code changes is improved, but accuracy of program replay is worsened due to timing issues and race conditions

Engineering Contradiction:
Improverobustness to code changesVSAvoidaccuracy of program replay
Core Design Contradiction:
Ease of manufactureVSMeasurement precision

Solution Approach 1:

The patent introduces an intermediary recording system that captures thread execution sequences and synchronization events as metadata, separate from the actual program execution. This intermediary layer records the logical order of operations and thread interactions, allowing accurate replay without being affected by timing variations or race conditions in the original execution.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent segments the recording process into separate components: capturing thread execution sequences, capturing synchronization events (locks, semaphores, mutexes), and recording memory access patterns. This segmentation allows each component to be recorded independently and replayed in the correct sequence, maintaining accuracy while avoiding timing-related issues.

Inventive Principle:
Principle #1Segmentation

2Ease of manufacture

If source code instrumenters are used, then ease of expansion and tuning is improved, but applicability is worsened when source code is not available

Engineering Contradiction:
Improveease of expansion and tuningVSAvoidapplicability when source code is not available
Core Design Contradiction:
Ease of manufactureVSAdaptability or versatility

Solution Approach 1:

The patent replaces the mechanical approach of source code instrumentation with a binary instrumentation approach. Instead of modifying source code files, the system instruments the executable binary directly, allowing the same recording and replay functionality to work with compiled programs without requiring access to source code. This maintains ease of expansion while significantly improving adaptability.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

3Ease of manufacture

If binary patching systems are used, then reusability is improved, but portability across platforms is worsened

Engineering Contradiction:
ImprovereusabilityVSAvoidportability across platforms
Core Design Contradiction:
Ease of manufactureVSAdaptability or versatility

Solution Approach 1:

The patent records platform-specific synchronization parameters (lock types, semaphore values, mutex operations) and memory access patterns as abstracted metadata. During replay, these parameters are interpreted and executed on the target platform, allowing the same recording to adapt to different operating systems and hardware architectures. This maintains reusability while enabling cross-platform portability.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS8813079B1Thread management to prevent race conditions in computer programs
Publication Date: 2014.08.19 CA TECH INC
  • US8813079B1 patent drawing
  • US8813079B1 patent drawing
  • US8813079B1 patent drawing

AI summary

Recording and replaying computer programs includes state synchronization and thread management techniques that facilitate accurately replaying the recorded execution of a multithreaded application program.