Re: CoreData & Multithreading...
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