liveBook · Manning

Shared_mutex

A C++ standard library mutex type that permits either exclusive ownership by one thread or shared ownership by multiple threads.

How 2 Manning books explain it

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

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.