Are gcc's STL empty methods threadsafe?
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.
精彩评论