Multithreaded Program Global State Recovery via Consistency Graphs

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In multithreaded programs, especially those using lock-based concurrency control, there is no conventional way to ensure data consistency across threads, leading to potential corruption of persistent data structures in case of a system crash, as updates within critical sections may not be visible after a restart unless all other updates are also visible.

Innovation Solution

A technique is introduced to identify and manage globally consistent states by maintaining happens-before and dependence graphs, allowing for the identification of locally consistent states and their aggregation to determine a globally consistent state, ensuring that all updates within critical sections are visible after a crash or restart.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If lock-based concurrency control is used in multithreaded programs, then concurrency control is enforced, but data consistency across threads cannot be ensured and persistent data structures may be corrupted upon system crash

Engineering Contradiction:
Improvedata consistencyVSAvoidcomplexity of consistency management
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system performs preliminary actions by identifying and recording locally consistent states (LCS) and their dependencies before a crash occurs. The happens-before graph and dependence graph are built in advance during normal operation, capturing the ordering relationships and data dependencies between memory states. This preliminary documentation enables rapid recovery to a consistent global state after a crash without requiring complex runtime consistency checks.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The invention segments the complex problem of global consistency into manageable parts by first identifying locally consistent states (LCS) at individual thread levels, then using dependence graphs to determine which LCS combinations form globally consistent states (GCS). This segmentation allows the system to handle consistency verification in discrete, tractable units rather than attempting to verify all possible thread interleavings simultaneously.

Inventive Principle:
Principle #1Segmentation

2Measurement precision

If conventional concurrency control mechanisms are used, then thread synchronization is achieved, but there is no way to verify whether a consistent state has been reached

Engineering Contradiction:
Improvestate verification capabilityVSAvoidverification mechanism complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The system uses visual metaphors of state labeling (analogous to color changes) by associating unique identifiers with different consistency states. Memory states are labeled with LCS identifiers and GCS status, enabling clear distinction between consistent and inconsistent states. This labeling approach provides precise state verification without requiring complex analytical checks, as the consistency status is explicitly marked and traceable through the dependence graphs.

Inventive Principle:
Principle #32Color changes

Solution Approach 2:

The invention implements feedback mechanisms by continuously monitoring and recording the happens-before relationships between memory states and maintaining dependence graphs that reflect the current consistency status. This feedback loop provides real-time information about which states are locally consistent and which combinations form globally consistent states, enabling the system to verify consistency without exhaustive checking.

Inventive Principle:
Principle #23Feedback

3Productivity

If updates are made within critical sections without additional consistency mechanisms, then execution speed is maintained, but updates may not be visible after a crash unless all other updates are also visible

Engineering Contradiction:
Improveexecution speedVSAvoidupdate visibility consistency
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system performs preliminary documentation of all memory state changes and their ordering relationships during normal execution, building the happens-before graph and dependence graph in advance. This preliminary action captures the intended visibility semantics of critical section updates without slowing down execution. Upon crash, this pre-recorded information enables deterministic verification of which updates should be visible, eliminating the need for complex runtime consistency protocols that would slow down execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The invention introduces intermediary data structures (the happens-before graph and dependence graph) that mediate between the critical section updates and the persistence layer. These intermediaries record the ordering and dependency relationships without interfering with the speed of critical section execution. They serve as a buffer that enables post-crash verification of update visibility consistency without requiring real-time coordination overhead during normal operation.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS8813042B2Identifying globally consistent states in a multithreaded program
Publication Date: 2014.08.19 HEWLETT PACKARD ENTERPRISE DEV LP
  • US8813042B2 patent drawing
  • US8813042B2 patent drawing
  • US8813042B2 patent drawing

AI summary

In a method of identifying a globally consistent state in a multithreaded program, a plurality of locally consistent states is identified, in which a locally consistent state of a thread comprises a set of memory locations and their corresponding data values accessed between points in the multithreaded program where no locks are held. Globally consistent states are identified based at least in part on the locally consistent states.