> Is std::queue thread-safe, or shall I use some synchronization
> facilities such as pthread_mutex to make sure my usage is thread-safe?
The C++ standard doesn't say anything about threads. As with any C++
extension, check your compiler's documentation. I highly suggest you
consider using lock/wait free data structures instead, even if you
don't get the benifit of having an STL container class:
http://en.wikipedia.org/wiki/Lock-fr...ree_algorithms
http://appcore.home.comcast.net/
http://www.cs.chalmers.se/~noble/
http://www.cl.cam.ac.uk/Research/SRG/netos/lock-free/