Runtime Data Collision Detection via Memory Capture and Thread Delay
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Data collisions between concurrent threads in multithreaded applications are difficult to detect, often manifesting as in-deterministic program behavior due to unpredictable changes in shared memory, and existing detection methods are unreliable and typically not performed at the kernel level.
Innovation Solution
A technique involving the capture of shared memory content before access, artificial delay of the thread, and subsequent comparison to detect changes, allowing for the identification of data collisions through code inserted into the application after compilation, which can be implemented at runtime without requiring complex analysis or kernel-level access.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Difficulty of detecting and measuring
If complex analysis is used to predict data collisions, then detection capability is improved, but reliability deteriorates due to false positive detection
Solution Approach 1:
The patent applies preliminary action by capturing the value of shared memory locations before the thread accesses them. This pre-capture creates a baseline that can be compared against the actual accessed value, enabling reliable detection of data collisions without requiring complex predictive analysis. The comparison between captured and actual values provides definitive evidence of collisions rather than probabilistic predictions.
2Measurement precision
If thread delay is introduced to detect data collisions, then detection accuracy is improved, but productivity deteriorates due to execution time increase
Solution Approach 1:
The patent applies partial action by introducing delay only at specific critical points where shared memory access occurs, rather than delaying entire threads uniformly. The delay is applied selectively before accessing shared memory locations that are candidates for collision detection. This targeted approach maintains detection accuracy while minimizing the overall impact on program execution speed.
3Ease of operation
If code insertion is used to implement detection, then ease of operation is improved, but device complexity increases
Solution Approach 1:
The patent applies the intermediary principle by introducing a detection mechanism that operates as a separate layer between the thread execution and shared memory access. The captured values are stored in intermediate storage locations, and the comparison logic acts as a mediator that detects collisions without fundamentally altering the original program logic. This separation maintains operational simplicity while managing code complexity.
Data Source
AI summary
Described are techniques for detecting data collisions between a first portion and a second portion of an application executing on a computer, the first portion and the second portions executing concurrently with respect to each other. While the first portion and second portion are executing, before the first portion accesses a memory location shared by the first portion and the second portion, a value stored in the memory location is captured and the first portion is delayed. While the second portion continues to execute the first portion is delayed. After a period of the first portion having been paused or slowed, the current content of the memory location is compared with the captured content to determine if there is a data collision. The first and second portions may be threads, and the capturing, delaying, and determining may be performed by code inserted to the application after it has been compiled.


