I have a data structure that has two methods of accessing it: query () and modify (). Several threads can use query () at the same time, but only one thread can introduce modification (), and at the same time, all threads using query () must exit before access to the modify () function occurs.
What is the best way to make this data structure unsafe in C ++?
(I read about enhanced read / write locks, but I was told that it could be 3-40 times slower than using mutexes)
source share