I have a global object holding several c++ std::map objects. This object is supposed to be read only in a multithreaded environment. But i’m not sure whether there is any write operation when a C++ std::map object is being read within the implementation of std::map. The IDE is Visual Studio 2008. Should I provide some synchronization mechanisms for read operations?
I have a global object holding several c++ std::map objects. This object is supposed
Share
Yes this will be OK provided nobody is writing to the map. See here for full details.
Thread safety of std::map for read-only operations