"is std::queue thread safe with producer and multiple consumers" Code Answer
5
you must protect access to std::queue. if you are using boost protect it using boost::mutex. now if you have multiple readers and one writer thread look at boost::shared_lock (for readers) and boost::unique_lock(for writer).
however if you will encounter writer thread starvation look at boost::shared_mutex.
you must protect access to
std::queue
. if you are using boost protect it usingboost::mutex
. now if you have multiple readers and one writer thread look atboost::shared_lock
(for readers) andboost::unique_lock
(for writer).however if you will encounter writer thread starvation look at
boost::shared_mutex
.