Conditional Locking Mechanism for Concurrent Resource Access
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing multi-threaded environments face inefficiencies due to over-inclusive locking mechanisms that prevent concurrent access to shared resources, even when race conditions are not present, leading to reduced system throughput.
Innovation Solution
A conditional locking mechanism that allows resources to be locked based on developer-defined conditions, using attributes of the access operation and target, enabling finer-grained control over locking, such as prohibiting concurrent write operations while allowing read operations on the same target.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional locking mechanisms are used to prevent race conditions, then data consistency is ensured, but system throughput is reduced due to over-inclusive locking
Solution Approach 1:
The patent segments the locking mechanism from the resource itself by introducing a separate concurrency dictionary and key-generation system. Instead of locking the entire resource, the system generates unique keys based on operation attributes and locks only specific key entries in the concurrency dictionary, allowing fine-grained control over which operations require serialization.
Solution Approach 2:
The patent applies local quality by making locking decisions based on specific attributes of the operation and target rather than applying a uniform locking policy. The key generation function creates localized locks tailored to the specific operation characteristics, ensuring that only operations with conflicting attributes are serialized while others can proceed concurrently.
2Productivity
If fine-grained conditional locking is implemented, then system throughput is improved by allowing safe concurrent access, but device complexity increases
Solution Approach 1:
The patent implements a universal key generation function that handles multiple operation types and target attributes through a single mechanism. The concurrency dictionary serves multiple purposes: tracking active locks, generating unique identifiers, and managing lock scope. This multi-functionality reduces the need for separate locking mechanisms for different operation types.
Solution Approach 2:
The system performs self-service by automatically generating unique keys based on operation attributes without requiring manual lock management. The concurrency dictionary self-manages the lock state, automatically creating and tracking locks based on the key-generation function, reducing the complexity of lock management for developers.
Data Source
AI summary
A conditional locking system receives, from a request source, a request to execute an operation on a target resource on behalf of a client thread. The system generates a unique key based on an attribute of the request and searches a concurrency dictionary for an entry identifying the unique key. In response to determining that the concurrency dictionary does include an entry identifying the unique key, the system identifies a lock object associated in the entry with the unique key and transmits a request to acquire the lock object. Once the lock object associated with the unique key has been acquired on behalf of the client thread, the system transmits a lock acquisition confirmation to the request source.


