My understanding is: std::mutex blocks other threads no matter if they want to read or write, whereas boost::shared_mutex will allow multiple reads.
So my question is, should I always prefer a boost::shared_mutex instead of a normal std::mutex to allow the possibility of parallel reads to take place? Using a normal std::mutex feels like I am denying some possible read throughput....?
shared_mutexis more costly to lock than a plain one, and can be a source of contention if your readers are only locking for a short period of time.shared_mutex.std::mutexis standard in C++11, but Boost is not.