Categories
Is map thread safety while writing from a thread?
c++20 standard. The essence of the question is stated in the title. If the answer is no, then what would be the best way to fix this, a normal mutex?
Answer the question
In order to leave comments, you need to log in
As far as I know, none of the containers in the standard library are thread safe. Therefore, you should create a wrapper class over the container and synchronize reading and writing with std::shared_mutex.
std::shared_mutex
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question