My class has the property:
@property (readwrite, atomic) BOOL IsTrue;
My understanding of the atomic qualifier is that @synthesize d getter / setter for a property guarantees serialization of access from different threads, i.e. if the producer stream is A set ting the value of the property, it will be allowed to complete the given operation before the consumer flows B and C are allowed to get the property value (as a digression, is atomic even necessary for a single byte / type POD?).
Does the volatile keyword provide extra data integrity?
@property (readwrite, atomic) volatile BOOL IsTrue;
What I'm doing is that there is a possibility that consumer threads will get obsolete values โโwithout using volatile ?
source share