开发者

Is it safe to use C++ STL containers on multiple threads if no insertions and only .find()?

开发者 https://www.devze.com 2022-12-18 02:25 出处:网络
In C++, is it safe to use an std::map or std::vector concurrently in different threads if you are NOT inserting, just doing .find() operations on开发者_高级运维 it?The current C++ Standard has nothing

In C++, is it safe to use an std::map or std::vector concurrently in different threads if you are NOT inserting, just doing .find() operations on开发者_高级运维 it?


The current C++ Standard has nothing to say on the subject of threading, and so does not address this issue. The documentation for your specific C++ Standard Library implementation should cover it, however.


This is implementation specific and not guaranteed by the standard.


Yes. No memory changes or caching are going to happen under the hood.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号