Transaction Conflict Detection Using Hash Maps
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current concurrency control methods for software applications, such as semaphores and Software Transactional Memory (STM), either adopt a pessimistic approach that restricts resource access or an optimistic approach that may lead to resource rollback, inefficiently managing shared resources and CPU cycles.
Innovation Solution
Implementing a static conflict analysis between atomic sections of software code using counters, conflict hash maps, and read set hash maps to validate transactions and determine whether to commit or abort, thereby reducing CPU cycles and improving concurrency control efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If optimistic STM approach is used to allow concurrent access to shared resources, then resource utilization improves, but validation overhead and CPU cycles increase
Solution Approach 1:
The system performs preliminary static conflict analysis at compile time to generate a conflict hash map that pre-identifies potential conflicts between transactions. This preliminary action allows runtime validation to focus only on relevant conflicts, reducing validation overhead while maintaining high resource utilization
Solution Approach 2:
The validation process is segmented into two phases: static conflict analysis phase that generates conflict hash maps, and runtime validation phase that uses these maps to quickly determine conflicts. This segmentation reduces runtime validation overhead by moving heavy analysis work to compile time
2Reliability
If pessimistic semaphore or lock approach is used to ensure resource access safety, then conflict detection reliability improves, but resource access efficiency deteriorates
Solution Approach 1:
Instead of preventing conflicts before they occur (pessimistic approach), the system allows transactions to proceed and validates them afterward using STM validation with conflict hash maps. This inversion maintains reliability by detecting conflicts while improving efficiency by avoiding premature resource blocking
Solution Approach 2:
The system uses conflict hash maps to provide feedback during runtime validation about whether a transaction conflicts with other transactions. This feedback mechanism ensures reliable conflict detection while allowing efficient concurrent execution, as transactions only need to check relevant conflicts identified in the hash maps
3Measurement precision
If full read set hash map validation is performed for every transaction, then conflict detection accuracy improves, but CPU cycles and processing time increase
Solution Approach 1:
The conflict hash map pre-identifies which shared locations are likely to be involved in conflicts between transactions. During runtime validation, the system only needs to check these pre-identified locations rather than validating the entire read set hash map, maintaining accuracy while reducing CPU cycles
Solution Approach 2:
The system extracts only the relevant conflict-prone entries from the read set hash map using the conflict hash map as a guide. This extraction approach maintains conflict detection accuracy by focusing on critical entries while reducing the number of CPU cycles needed for validation
Data Source
AI summary
Illustrated is a system and method for identifying a potential conflict, using a conflict determination engine, between a first transaction and a second transaction stored in a conflict hash map, the potential conflict based upon a potential accessing of a shared resource common to both the first transaction and the second transaction. The system and method further includes determining an actual conflict, using the conflict determination engine to access the combination of the conflict hash map and the read set hash map, between the first transaction and the second transaction, where a time stamp value of only selected shared locations has changed relative to a previous time stamp value, the time stamp value stored in the read set hash map and accessed using the first transaction.


