• 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: NSKeyedUnarchiver - unarchiving on a background thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSKeyedUnarchiver - unarchiving on a background thread (From: nick briggs <email@hidden>)

  • Prev by Date: Re: keyDown and Enter/Tab keys
  • Next by Date: Re: container retain/release problem
  • Previous by thread: NSKeyedUnarchiver - unarchiving on a background thread
  • Next by thread: NSUserDefaults example?
  • Index(es):
    • Date
    • Thread