Race Condition Detection via Read-Only Variable Copies

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for detecting race conditions in multithreaded computer programs often require write access to shared resources and may introduce safety weaknesses or rely on functional synchronization primitives, which can fail due to hardware defects.

Innovation Solution

A method that uses two copies of variables per core, allowing read-access to one core's variables from another, enabling detection of race conditions without write access to common global variables and without relying on functional synchronization primitives, ensuring safety and hardware independence.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If write access to shared resources is required for race condition detection, then detection capability is improved, but safety weaknesses are introduced

Engineering Contradiction:
Improverace condition detection capabilityVSAvoidsafety weakness
Core Design Contradiction:
Measurement precisionVSReliability

Solution Approach 1:

The patent divides the shared resource access detection into separate read and write operations. Each core maintains its own copy of variables and only performs read operations on other cores' variables, eliminating the need for write access to shared resources while maintaining detection capability

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary mechanism where each core has private variables that serve as indicators. Instead of directly writing to shared resources, cores update their private variables which other cores can read, thus detecting race conditions without compromising safety through write access

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If synchronization primitives are used for race condition prevention, then thread coordination is improved, but hardware defect failures occur

Engineering Contradiction:
Improvethread coordinationVSAvoidhardware defect failure
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The patent enables threads to self-detect race conditions by reading variables from other cores without requiring external synchronization primitives. Each thread independently monitors for race conditions through read operations, eliminating dependency on hardware synchronization mechanisms that may fail

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent replaces mechanical hardware synchronization primitives with a software-based detection mechanism using read-only memory access. This substitution eliminates the reliability issues associated with hardware defects in synchronization primitives while maintaining thread coordination capability

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

3Adaptability or versatility

If common global variables are written to by multiple cores, then shared resource access is enabled, but safety-related weaknesses are introduced

Engineering Contradiction:
Improveshared resource accessVSAvoidsafety-related weakness
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent segments the global variables into core-specific private variables. Each core maintains its own copy of variables and only reads from other cores' variables, eliminating the safety weaknesses of multi-core write access while preserving shared resource access functionality

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent creates copies of variables for each core instead of using a single shared global variable. Each core has its own private variables that other cores can read, enabling shared access patterns without the safety risks of concurrent writes to common memory

Inventive Principle:
Principle #26Copying

Data Source

PatentUS9842009B2Method and device for detecting a race condition and a computer program product
Publication Date: 2017.12.12 NXP USA INC
  • US9842009B2 patent drawing
  • US9842009B2 patent drawing
  • US9842009B2 patent drawing

AI summary

A method is provided for detecting a race condition of a parallel task when accessing a shared resource in a multi-core processing system. The method requires that a core requires only a read access to the data set of another core, thereby ensuring better decoupling of the tasks. In an initialisation phase, initial values of global variables are assigned, in an activation phase, each core determines if the other core has written new values to the variables and if so, detects a race condition. Initial values are restored for each variable in a deactivation phase.