dispenso
A library for task parallelism
 
Loading...
Searching...
No Matches
dispenso::RWLock Class Reference

#include <rw_lock.h>

Inherits detail::RWLockImpl.

Detailed Description

A reader/writer lock interface compatible with std::shared_mutex (for use with std::unique_lock and std::shared_lock). The interface is designed to be very fast in the face of high levels of contention for high read traffic and low write traffic.

Note
RWLock is not as fully-featured as std::shared_mutex: It does not go to the OS to wait. This behavior is good for guarding very fast operations, but less good for guarding very slow operations. Additionally, RWLock is not compatible with std::condition_variable, though std::condition_variable_any may work (untested). It could be possible to extend RWLock with it's own ConditionVariable, make waiting operations sleep in the OS, and also to add timed functions; however those may slow things down in the fast case. If some/all of that functionality is needed, use std::shared_mutex, or develop a new type.

Definition at line 25 of file rw_lock.h.


The documentation for this class was generated from the following file: