• 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: CoreData & Multithreading...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData & Multithreading...


  • Subject: Re: CoreData & Multithreading...
  • From: Lee Morgan <email@hidden>
  • Date: Tue, 24 May 2005 22:30:03 -0400

On May 24, 2005, at 10:08 PM, Bill Bumgarner wrote:

I have a suggestion -- don't use threads. Or, at least, don't directly use threads. If this is your first real threading experience, it is going to be very painful. Threads are hard.

The NSURL APIs found in Foundation handle downloading of data in the background. Assuming that updating of various objects does not take an inordinately large amount of time, the simplest approach would be to do the downloads in the background via the NSURL APIs and then perform the updating in the main event loop.

Good suggestion. Strangely I didn't even think of NSURL having this capability built it. Updating the objects shouldn't require much at all, it will probably only be a matter of setting pointers, then allowing bindings to take care of the rest. And since this should only lock the GUI for a very short time every few seconds the user may not ever notice.


(And please don't take the above as an insult. I have done a lot of threaded programming, most of it wrong in hindsight. Even when it works flawlessly, which is rare, most threaded code has so many actively toggled mutexes that the app is effectively single threaded. Threading is just really, really hard.)

No insult taken. Like I said, I'm new to threading - all advice is welcomed. Besides, you may have just given me a way to handle all of this without the extra work involved in threading it.


- lee
_______________________________________________
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: 
 >CoreData & Multithreading... (From: Lee Morgan <email@hidden>)
 >Re: CoreData & Multithreading... (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Re: Subversion
  • Next by Date: Working set bloat in Xcode 2
  • Previous by thread: Re: CoreData & Multithreading...
  • Next by thread: Working set bloat in Xcode 2
  • Index(es):
    • Date
    • Thread