Lockless Resource Versioning for Shared Memory Concurrency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional single writer multiple reader technologies face inefficiencies due to locking mechanisms and read counting procedures, which impair performance by restricting simultaneous access to shared memory and consuming processing power.
Innovation Solution
Implementing lockless resource versioning by publishing contexts that represent snapshots of data structures at different times, allowing multiple readers to access shared memory without locks and eliminating the need for read counting, thereby enabling simultaneous access and reducing processing power consumption.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a locking mechanism is implemented to enable multiple readers and a single writer to lock objects in shared memory, then data consistency is maintained, but access efficiency deteriorates because locked objects become unreadable and overwritable for all processes that did not initiate the lock themselves
Solution Approach 1:
The patent segments the shared memory access control by creating versioned copies of data structures (contexts) for different time periods. Instead of locking the entire shared memory, readers can access specific versioned contexts that are segmented from the main shared memory structure, allowing concurrent access without interference.
Solution Approach 2:
The writer publishes a context representing the data structure at a specific moment in time before readers access it. This preliminary action of publishing a versioned context allows readers to access data without waiting for locks, as the context is already prepared and versioned for safe concurrent reading.
2Reliability
If a locking mechanism is implemented to enable multiple readers and a single writer to lock objects in shared memory, then data consistency is maintained, but processing overhead increases due to the time and processing power required for locking and unlocking procedures
Solution Approach 1:
The patent replaces the mechanical locking system with a versioning-based access control mechanism. Instead of using locks that require acquisition and release procedures, the system uses versioned contexts with generation counters that automatically manage access without requiring locking operations, thereby eliminating the processing overhead associated with lock management.
Solution Approach 2:
The system creates copies of the data structure in the form of versioned contexts that represent the data at specific moments in time. These copied contexts can be accessed by multiple readers simultaneously without affecting the original shared memory or requiring lock operations, reducing processing power consumption while maintaining data consistency.
3Reliability
If a read counting mechanism is implemented to track the number of readers accessing objects in shared memory, then resource reclamation is enabled, but performance deteriorates due to the time and processing power required for incrementing and decrementing the read count
Solution Approach 1:
The system uses versioned contexts that are copies of the data structure at specific time points. Each context contains information about the data version and can be independently managed. This eliminates the need for read counting mechanisms, as the versioning system naturally tracks resource usage through context generation and publication, enabling resource reclamation without the performance overhead of incrementing and decrementing counters.
Solution Approach 2:
The patent extracts the read counting function from the access control mechanism by incorporating version information directly into the context structure. The generation counter and version metadata are embedded in each context, allowing the system to track resource usage and enable reclamation through the versioning mechanism itself rather than through separate counting operations.
4Reliability
If a locking mechanism is implemented to enable multiple readers and a single writer to lock objects in shared memory, then data consistency is maintained, but system complexity increases due to the additional locking and unlocking procedures
Solution Approach 1:
The patent replaces the complex locking mechanism with a simpler versioning system. Instead of requiring lock acquisition, lock holding, and lock release procedures, the system uses versioned contexts with generation counters that provide automatic access control. This substitution reduces system complexity by eliminating the need for synchronization primitives while maintaining data consistency through version isolation.
Solution Approach 2:
By creating versioned copies of the data structure in the form of contexts, the system simplifies access control. Readers access immutable copies rather than competing for locks on shared memory, and writers publish new versions without needing to coordinate with readers. This copying approach reduces system complexity by removing the need for complex locking protocols while ensuring data consistency.
Data Source
AI summary
A disclosed method may include (1) publishing, by a writer, a first context that represents a lockless data structure at a first moment in time for access by a set of readers, (2) upon the publication of the first context, directing at least one of the readers to access an object stored in shared memory via the first context, (3) publishing, by the writer, a second context that represents the lockless data structure at a second moment in time for access by the set of readers, and (4) upon the publication of the second context, directing the at least one of the readers to access an additional object stored in the shared memory via the second context. Various other apparatuses, systems, and methods are also disclosed.


