I know there has been much discussion, one of which is https://stackoverflow.com/a/12969166/1724763 but the answer is not very clear.
I just want focus on specific use cases of atomic not found elsewhere (in the context of ARC)
For example, I have :
@property (nonatomic, strong) someobject;
In this case, someobject is written once in init
and readonly thereafter by multiple threads.
Do I have to make it atomic
? What exactly does the getter do? just return the pointer?
For scalars and non-objective c objects, can I just make them nonatomic
for multi-thread readwrite? I understand that on Intel processors reading and writing an aligned int is always atomic.
Also, when accessing an atomic property, should I assign to a local variable first and use the local var to improve performance?