• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Threadsafe copy of objective c object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threadsafe copy of objective c object


  • Subject: Re: Threadsafe copy of objective c object
  • From: Markus Spoettl <email@hidden>
  • Date: Tue, 03 Sep 2013 14:26:17 +0200

On 9/3/13 1:23 PM, Jonathan Taylor wrote:
-	True thread safety would require a copy that represents an instantaneous
snapshot of the state of the entire object, i.e. copy not taken while object
is being updated. Actually, I suspect this last condition is not a problem
for my specific case, but best to be on the safe side, for several different
reasons.

That means you have to make the copy and write accesses to the individual properties mutually exclusive. Depending on the number of properties in your object, it might be easier to completely exchange the object whenever you want to mutate one if its properties, basically treating the whole object immutable. Copying is trivial then. Of course it depends on how many times a second you need to change properties.

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Threadsafe copy of objective c object (From: Jonathan Taylor <email@hidden>)
 >Re: Threadsafe copy of objective c object (From: Graham Cox <email@hidden>)
 >Re: Threadsafe copy of objective c object (From: Jonathan Taylor <email@hidden>)

  • Prev by Date: Re: Threadsafe copy of objective c object
  • Next by Date: Re: Threadsafe copy of objective c object
  • Previous by thread: Re: Threadsafe copy of objective c object
  • Next by thread: Re: Threadsafe copy of objective c object
  • Index(es):
    • Date
    • Thread