Skip to content

Instantly share code, notes, and snippets.

@djkskqyr3
Created December 14, 2014 08:26
Show Gist options
  • Select an option

  • Save djkskqyr3/aaf9c91f72658ff16fe1 to your computer and use it in GitHub Desktop.

Select an option

Save djkskqyr3/aaf9c91f72658ff16fe1 to your computer and use it in GitHub Desktop.

Revisions

  1. James Chan created this gist Dec 14, 2014.
    3 changes: 3 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    With "atomic", the synthesized setter/getter will ensure that a whole value is always returned from the getter or set by the setter, regardless of setter activity on any other thread. That is, if thread A is in the middle of the getter while thread B calls the setter, an actual viable value -- an autoreleased object, most likely -- will be returned to the caller in A.

    In nonatomic, no such guarantees are made. Thus, nonatomic is considerably faster than "atomic".