Re: NSKeyedUnarchiver - unarchiving on a background thread
Re: NSKeyedUnarchiver - unarchiving on a background thread
- Subject: Re: NSKeyedUnarchiver - unarchiving on a background thread
- From: email@hidden
- Date: Thu, 10 Feb 2005 14:25:41 -0800
On Feb 10, 2005, at 1:03 PM, nick briggs wrote:
Is NSKeyedUnarchiver not threadsafe?
You aren't using NSKeyedUnarchiver from multiple threads in this code
anyway. The unarchival will happen atomically prior to setting the the
_stuff instance variable.
This looks more like _stuff either contains garbage or is uninitialized
when your UI starts to try to display stuff.
Consider what your implementation of -loadDataRepresentation: is doing.
It is returning IMMEDIATELY that the data has been successfully
loaded before data loading has likely even commenced. The UI will
then begin to immediately updated itself based on the not-yet-loaded
_stuff.
Worse -- sometime in the middle of updating the UI based on the
not-yet-assigned _stuff, your are swapping _stuff in the background
thread. Thus, any of the various components that may have queried the
previous _stuff to determine things like object counts or values may
suddenly be talking to a very different _stuff.
b.bum
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden