There are two threads (t1 and t2) attached to two different cores. They both share a common variable, which is a raw pointer to some type of class. t1 only reads the pointer, and t2 reads / writes the pointer. Should I declare a pointer as just mutable or atomic or both?
When t2 updates this pointer, it is normal if t1 reads old or new, but it should not read any intermediate value, as this will cause seg to fail.
balki source share