Shared_mutex
A C++ standard library mutex type that permits either exclusive ownership by one thread or shared ownership by multiple threads.
Object-Oriented Software Design in C++
A C++ standard library synchronization class that supports either exclusive ownership by one thread or shared ownership by multiple threads.
- How it is used
- Protects shared resources in reader-writer designs where concurrent reads are safe but modifications require exclusive ownership.
- How deep it goes
- Explains exclusive and shared ownership, then demonstrates both modes in meter access; it stops short of deeper locking internals.
- Examples
- Uses a shared meter updated by technician threads and read by logger threads.
- What you can do after
- Apply it via unique_lock and shared_lock to coordinate concurrent reads and exclusive writes.
Read how Object-Oriented Software Design in C++ explains shared_mutex →
C++ Concurrency in Action, Second Edition
A C++ standard library mutex type that supports either exclusive ownership by one thread or shared ownership by multiple threads.
- How it is used
- Protects data structures by allowing concurrent readers while keeping updates exclusive.
- How deep it goes
- Explains shared and exclusive lock usage with RAII types, and warns that performance depends on workload and processor count.
- Examples
- Uses a DNS cache map with shared lookup locks and an exclusive update lock.
- What you can do after
- Apply shared and exclusive locks to protect read-heavy data structures, then profile performance on the target system.
Read how C++ Concurrency in Action, Second Edition explains shared_mutex →
Related concepts
- shared_lockused by · A C++ standard library class template that manages shared ownership of a mutex.
- lock_guardused by · std::lock_guard is a C++ standard library class template that acquires a mutex when constructed and releases it when destroyed.
- Mapused by · A map is an associative data structure that stores key-value pairs and supports retrieving values by key.
- concurrent accessuses · Concurrent access is the overlapping use of shared data or resources by multiple operations or execution contexts.
- unique_lockconfigured by · std::unique_lock is a C++ standard library class template that manages exclusive ownership of a mutex and supports deferred locking, unlocking, and ownership transfer.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

