Home > DeveloperSection > Interviews > What is difference between atomic and nonatomic property specifier?

Posted on    April-21-2015 1:19 AM

 iPhone iPhone  Ios 
Ratings:
 1 Answer(s)
  1173  View(s)
Rate this:

Sunil Singh
Sunil Singh

Total Post:32

Points:160
Posted on    April-21-2015 1:19 AM

Atomic means only one thread access the variable but nonatomic means multiple thread access the variable .Atomic is thread safe but nonatomic is thread unsafe.Atomic is fast in performance but nonatomic  is slow in performance.Atomic is default behavior but nonatomic is not default behavior . we need to add nonatomic keyword in property attribute. Nonatomic may result in unexpected behavior, when two different process (threads) access the same variable at the same time.

Don't want to miss updates? Please click the below button!

Follow MindStick