Storage System Synchronization Object Using Atomic Stamp
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing synchronization methods in storage systems can lead to race conditions and deadlocks due to missed notification events, where waiting threads fail to receive completion signals for operations, causing them to wait indefinitely.
Innovation Solution
A synchronization object utilizing a stamp and thread queue ensures that threads waiting for operation completion are always notified, using a spinlock for atomicity and a counter (stamp) to distinguish operation instances and signal completion, preventing missed notifications.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional notification events are used for synchronization, then threads can be notified of operation completion, but threads may miss notification events causing race conditions and deadlocks
Solution Approach 1:
The patent introduces a stamp as an intermediary mechanism between the operation completion event and the waiting threads. The stamp acts as a mediator that carries information about operation completion, allowing threads to reliably detect completion without missing notifications. The stamp is updated atomically with the operation result and can be read by any waiting thread, eliminating the reliability issue of traditional notification events.
Solution Approach 2:
The patent replaces the mechanical notification event system with a data-based stamp system. Instead of relying on threads to correctly receive and process notification events (which can be missed), the system uses a readable stamp that persistently stores the operation completion state. This substitution eliminates the information loss problem by making the completion state explicitly visible and不可丢失.
2Productivity
If multiple threads wait for the same operation completion, then resource utilization improves, but threads may wait indefinitely causing deadlocks
Solution Approach 1:
The patent implements feedback by having waiting threads continuously check the stamp value to determine if the operation has completed. The stamp provides real-time feedback about the operation status, allowing threads to immediately detect completion and proceed without indefinite waiting. This feedback mechanism ensures that all waiting threads are notified of completion while preventing deadlocks.
Solution Approach 2:
The patent enables threads to self-service by allowing them to independently check the stamp value without requiring external notification. Each thread can autonomously determine whether to wait or proceed based on the current stamp value, eliminating the need for complex notification management and preventing indefinite waiting while maintaining high resource utilization.
3Reliability
If a synchronization object uses atomic operations for stamp updates, then thread safety is ensured, but operation overhead increases
Solution Approach 1:
The patent changes the parameter representation by using a simple integer stamp value that can be updated atomically. This parameter change allows the system to achieve thread safety through lightweight atomic increment operations rather than complex locking mechanisms. The stamp value serves as both the synchronization state and the notification mechanism, reducing overhead while ensuring reliability.
Data Source
AI summary
In one aspect, an example methodology implementing the disclosed techniques includes, responsive to a determination, by a first thread attempting to start an operation, that a second thread has started the operation, obtaining a value of a stamp included in a synchronization object related to the operation. The method also includes determining, by the first thread, whether the value of the stamp obtained is the same as a current value of the stamp and, responsive to a determination that the obtained value of the stamp is not the same as the current value of the stamp, continuing execution of the first thread. The method may further include, responsive to a determination that the obtained value of the stamp is the same as the current value of the stamp, suspending execution of the first thread.


