reader_writer_lock Class
A writer-preference queue-based reader-writer lock with local only spinning. The lock grants first in - first out (FIFO) access to writers and starves readers under a continuous load of writers.
class reader_writer_lock;
Members
Public Classes
Name |
Description |
---|---|
An exception safe RAII wrapper that can be used to acquire reader_writer_lock lock objects as a writer. |
|
An exception safe RAII wrapper that can be used to acquire reader_writer_lock lock objects as a reader. |
Public Constructors
Name |
Description |
---|---|
Constructs a new reader_writer_lock object. |
|
Destroys the reader_writer_lock object. |
Public Methods
Name |
Description |
---|---|
Acquires the reader-writer lock as a writer. |
|
Acquires the reader-writer lock as a reader. If there are writers, active readers have to wait until they are done. The reader simply registers an interest in the lock and waits for writers to release it. |
|
Attempts to acquire the reader-writer lock as a writer without blocking. |
|
Attempts to acquire the reader-writer lock as a reader without blocking. |
|
Unlocks the reader-writer lock based on who locked it, reader or writer. |
Remarks
For more information, see Synchronization Data Structures.
Inheritance Hierarchy
Requirements
Header: concrt.h
Namespace: Concurrency