开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜