BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslmt_readerwritermuteximpl

Detailed Description

Outline

Purpose

Provide a multi-reader/single-writer lock.

Classes

See also
bslmt_readerwriterlock

Description

This component defines an efficient multi-reader/single-writer lock mechanism, bslmt::ReaderWriterMutexImpl. It is designed to allow concurrent read access to a shared resource while still controlling write access.

Reader-writer locks are generally used for resources that are frequently read and less frequently updated. Unlike other lock mechanisms (e.g., "mutexes"), reader-writer locks provide two distinct but mutually exclusive lock states: a read lock state, and a write lock state.

To the extent the implementation's underlying mutex prevents a thread from starving, readers can not be starved by writers and writers can not be starved by readers. If the underlying mutex, to some extent, favors re-acquisition of the mutex to allowing a new thread to obtain the mutex (e.g., the mutex obtained on Linux), this reader-writer lock is writer biased since writers can re-acquire the lock in the presence of readers but readers will not be able to re-acquire the lock in the presence of writers.

Usage

There is no usage example for this component since it is not meant for direct client use.