user1687717
user1687717

Reputation: 3475

when should I use atomic ios?

most properties are declared as nonatomic, like

@property (nonatomic,strong) NSNumber *num;

If I'm using block queue to implement a concurrent program, what property should I declared as atomic?

Upvotes: 0

Views: 232

Answers (1)

phoganuci
phoganuci

Reputation: 5064

You should use the atomic specifier on this property if your program, as written, can possibly set and get this object from multiple threads. Use this specifier if you would like to place a lock on this object during setting.

Upvotes: 3

Related Questions