I have a data structure that has two methods to access it : query() and modify(). Multiple threads can use query() at the same time but only a single thread can enter modify() and at the same time all threads using query() has to exit before access occurs on modify().
What is the best way to make this data structure threadsafe in C++?
(I read up on boost read/write locking but I was told that it could be 3-40x slower than using mutexes)