stdsharedlockstdsharedmutex
stdsharedlockstdsharedmutex refers to the two related components in the C++ standard library that provide shared (read) synchronization: std::shared_lock and std::shared_mutex. They are defined in the header <shared_mutex> and are part of C++17 and later, with earlier equivalents existing in the form of std::shared_timed_mutex in some implementations.
std::shared_mutex is a mutex type that allows multiple threads to hold a shared lock simultaneously (readers),
std::shared_lock is a RAII wrapper that acquires a shared lock on a std::shared_mutex. It is designed for
Usage patterns commonly arise in read-mostly data structures, where many threads perform reads concurrently and occasional
See also: std::unique_lock, std::lock_guard, std::shared_timed_mutex.