I have a question: Are std::map and std::set thread-safe? I use this collections on my multithread applications and sometimes map and set works worng.
Thanks!
upd. My code:
std::map<int, unsigned long> ClientTable;
int sendulong(int socket, char * data) //<--- Many threads uses this function
{
write(socket, ClientTable[socket]); //<--- ClientTable[[socket] <-- using of map
}
How can i fix this code for thread safety? Thanks!