On Mar 20, 2010, at 4:24 AM, Philippe Sismondi <psismo...@arqux.com> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to