views:

24

answers:

1

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 won'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.

+4  A: 

No. You have to provide the thread safety.

Mike