Race Condition Detection via Read-Only Variable Copies
Find Innovative SolutionsGenerate 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
Engineering 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
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
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
2Ease of operation
If synchronization primitives are used for race condition prevention, then thread coordination is improved, but hardware defect failures occur
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
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
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
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
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
Data Source
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.


