Re: App modal window and secondary thread
Re: App modal window and secondary thread
- Subject: Re: App modal window and secondary thread
- From: Chris Hanson <email@hidden>
- Date: Sat, 20 Mar 2010 22:41:15 -0700
On Mar 20, 2010, at 4:24 AM, Philippe Sismondi <email@hidden>
wrote:
Had I not been compelled to support OS X 10.4 I would have re-
written the whole thing to use something better than threads - GCD
or NSOperationQueue capabilities are said to be safer, although I
have not yet learned them.
Let's nip this in the bud: NSOperation and GCD are not "safer than
threads" -they *are* threads.
They are a more convenient API but they're still concurrent
programming -and that's what's hard about programming against threads,
not the API itself.
In particular, they *do not* insulate you from AppKit or Core Data's
threading model. And a particular operation or dispatch to a
concurrent queue can be served by any thread, without any strong
binding to one thread (modulo the binding of the main queue to the
main thread).
I would also not invoke abortModal on a background thread just as a
matter of cleanliness. I'd implement a delegate/callback/notification
for my background processor to tell whatever is controlling it that
it's done. That's what would invoke abortModal - and it would do that
on the main thread/queue.
-- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden