This item covers ground Herb already presented in this video. He recommends that const member functions must be one of:
- truly physically/bitwise const with respect to this object
- internally synchronized so that if it does perform any actual writes to the object’s data, that data is correctly protected with a mutex or equivalent (or if appropriate are atomic) so that any possible concurrent non-const accesses by multiple callers can’t tell the difference.
Similarly, he asserts that the guidelines taught for C++98, that const means logically const but you had a free rein with internal data, is no longer true for C++11 with its memory model and thread safety specification.
This implies stricter best practice on use of mutable member variables. Any time you need to mutate data in a const member function, you should protect it with a synchronisation object to ensure thread safety.