This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
ReaderWriterLock Concepts
Defines the lock that implements single-writer / multiple-reader semantics that supports the following features:
- Cheap enough to be used in large numbers such as per object synchronization.
- Supports timeout. This is a valuable feature to detect deadlocks.
- Supports caching of events. This allows the events to be moved from least contentious regions to the most contentious regions. In other words, the number of events needed by Reader-Writer locks are bounded by the number of threads in the process.
- Supports nested locks by readers and writers.
- Supports spin counts for avoiding context switches on multi processor machines.
- Supports functionality for upgrading to a writer lock with a return argument that indicates intermediate writes. Downgrading from a writer lock restores the state of the lock.
- Supports functionality to Release Lock for calling app code. RestoreLock restores the lock state and indicates intermediate writes.
- Recovers from most common failures such as creation of events. In other words, the lock mainitains consistent internal state and remains usable.
For reference details see: ReaderWriterLock.