0

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?

user1687717
  • 2,933
  • 6
  • 22
  • 29

1 Answers1

3

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.

phoganuci
  • 4,644
  • 7
  • 37
  • 49