Can I access a C++11 std::map entry while inserting/erasing from another thread?
问题 Can I access (without locking) an std::map entry while another thread inserts/erases entrys? example pseudo C++: typedef struct { int value; int stuff; }some_type_t; std::map<char,some_type_t*> my_map; //thread 1 does: my_map.at('a')->value = 1; //thread 2 does: some_type_t* stuff = my_map.at('b'); //thread 3 does: my_map.erase('c'); //I'm not modifying any elements T is a pointer to an previously allocated "some_type_t" std C++11 says that all members should be thread safe (erase() is not