Is it possible to reverse the issue? Keep the original object (living on the 
main thread) untouched, make a copy for algorithm processing as an async task, 
then, when done, update the original object from the copy that may have been 
changed during async processing? Or will that cause the exact same problem in 
the final step?

Verstuurd vanaf mijn iPhone

Op 3 sep. 2013 om 13:16 heeft Lasse Jansen <la...@lasselog.com> het volgende 
geschreven:

>> Since the implementation of -copy is up to you, you could just put 
>> @synchronized(self){…..} around the code in that method. That implements a 
>> lock which should make the copy thread-safe.
> 
> 
> No, it wouldn't. It would only ensure that two calls to copy are executed 
> sequentially. You would need to add @synchronized(self) {…} to all other 
> methods that modify the object too to ensure that the object isn't changed 
> during a copy.
> 
> 
> Lasse
> 
> 
> 
> 
> Sent with Unibox
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/diederik%40tenhorses.com
> 
> This email sent to diede...@tenhorses.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to