开发者

Are gcc's STL empty methods threadsafe?

开发者 https://www.devze.com 2023-01-18 15:43 出处:网络
If I have a deque or list that\'s being manipulated on different threads, can I call empty without a lock?The standard doesn\'t say anything about threads, so I know this w开发者_JAVA百科on\'t be port

If I have a deque or list that's being manipulated on different threads, can I call empty without a lock? The standard doesn't say anything about threads, so I know this w开发者_JAVA百科on't be portable, but I'm using gcc 4.4. I'm also curious to know if this is safe on other implementations in case I ever decide to, say, switch to the intel compiler. But mostly, I care about gcc.


No. You have to provide the thread safety.

0

精彩评论

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