Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TReentrantRWLock Class Reference

An implementation of a reentrant read-write lock with a configurable internal mutex/lock (default Spin Lock).

This class provides an implementation of a reentrant read-write lock that uses an internal lock and a condition variable to synchronize readers and writers when necessary.

The implementation allows a single reader to take the write lock without releasing the reader lock. It also allows the writer to take a read lock. In other word, the lock is re-entrant for both reading and writing.

The implementation tries to make faster the scenario when readers come and go but there is no writer. In that case, readers will not pay the price of taking the internal spin lock.

Moreover, this RW lock tries to be fair with writers, giving them the possibility to claim the lock and wait for only the remaining readers, thus preventing starvation.


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