Any one having idea about thread safe data containers like queue, map? I dont want threadsafe STL when we use /MT switches for compiler.
A real thread safe wel tested STL containers.
Thread safe containers usually make no sense. Consider a 'thread-safe` queue:
if(!qu.empty())
{
// 1
qu.pop();
}
What if during #1 the queue is modified and it becomes empty? It breaks the code. This is why you should use locks in your code rather than 'thread-safe' containers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With