Do I need to guard my push() and pop() calls with a mutex, or are they internally thread safe?
The code I wish to write looks like this
parallel for (int i = 0; i < 100; i++) {
...
s.push(...);
...
}
I am not sure where to look about the thread safety of the STL containers I am using. I checked this reference, but it does not mention anything about thread safety.
They are not internally thread safe. Write operations to containers and container adapters from more than one thread are not required by the standard to be safe in this respect, so you have to apply some synchronisation mechanism.