Selective Locking for Large Data Structure Updates
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing data structures cannot be updated using atomic operations, and locking them during every update is undesirable due to performance issues, especially when only a small portion of the data structure needs to be updated.
Innovation Solution
A method that determines whether to lock a data structure based on the impact of an update to a first portion on a second portion, using atomic operations for small updates and locking for larger updates, allowing for efficient and lock-free updates in many cases.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the data structure is locked during every update, then data integrity is ensured, but performance deteriorates due to reduced access speed
Solution Approach 1:
The data structure is divided into a first portion that can be updated atomically and a second portion that requires locking. By segmenting the data structure, the patent enables fast atomic updates for the first portion while maintaining integrity for the second portion through selective locking, thus resolving the contradiction between speed and reliability.
Solution Approach 2:
Different parts of the data structure have different update characteristics. The first portion is designed for atomic updates (high speed), while the second portion uses locking (high reliability). This local differentiation allows each part to be updated according to its specific requirements, balancing performance and integrity.
2Speed
If atomic operation is used for updating, then update speed is improved, but data structure size is limited to atomic size
Solution Approach 1:
The data structure is segmented into a first portion (up to atomic size) and a second portion (beyond atomic size). The first portion benefits from fast atomic updates, while the second portion uses locking mechanisms. This segmentation allows the system to support larger data structures while maintaining fast update performance for the most commonly accessed portion.
3Reliability
If locking is used during update, then data integrity is maintained, but productivity decreases due to reduced update frequency
Solution Approach 1:
By segmenting the data structure into atomic-updatable and lock-required portions, the patent enables more frequent updates (improved productivity) for the first portion while maintaining integrity for the second portion. This reduces the overall locking frequency compared to locking the entire structure, thus improving update frequency.
Solution Approach 2:
Instead of locking the entire data structure, the patent applies locking only partially to the second portion when necessary. This partial action approach allows more updates to proceed without locking (improving productivity) while still ensuring integrity where needed.
Data Source
AI summary
An implementation repeatedly updates data in a data structure, the data structure having a size larger than an atomic size. The implementation avoids locking the data structure on every update, however. One method accesses data in a first portion of a data structure and estimates, based on the accessed data, an impact on data in a second portion of the data structure arising from an update to data in the first portion. The method then determines, based on the estimated impact, whether to lock the data structure during an update to data in the data structure. In a more particular example, a counter is copied on a regular basis. If only the least significant bits of the counter have changed, then an atomic instruction is used to copy only the least significant bits. However, when the more significant bits have changed, a lock is used to copy the entire counter.


