I\'ve a question about the thread safety of std::set.
As far as I know I can iterate over a set and add/erase members and that doesn\'t invalidate the iterators.
Yes. One way to handle this situation is to have each thread lock a shared mutex before accessing the same set object. Make sure you use RAII techniques to lock and unlock the mutex.