Re:Thread Safety in C++ and Rust
by nyanpasu64 on Saturday December 18, 2021 @10:44PM
(#29611119)
I interpreted the author saying "thread-compatible" to mean "accessor beware". Surprisingly in some cases, in C++ it's unsafe for multiple threads to even call const member functions on the same object, for example when the const method modifies a `mutable` field. One way this could happen is when a "const" method lazily computes a value and stores it in a field.
[ Parent
| on HN ]
There are no comments on this comment yet.