Re: receptionist pattern question: NSOperationQueue vs. GCD
Re: receptionist pattern question: NSOperationQueue vs. GCD
- Subject: Re: receptionist pattern question: NSOperationQueue vs. GCD
- From: Matt Neuburg <email@hidden>
- Date: Thu, 16 Feb 2012 08:09:33 -0800
On Wed, 15 Feb 2012 13:56:14 -0800, Kyle Sluder <email@hidden> said:
>On Wed, Feb 15, 2012 at 11:19 AM, Matt Neuburg <email@hidden> wrote:
>> My question is simply this: in a world that has GCD, is there any reason why we wouldn't have "queue" be a GCD dispatch queue (probably the main queue) and call dispatch_asynch? Putting it even more generally (and this is probably my *real* question), is there any reason why I'd ever use NSOperationQueue's addOperationWithBlock given the existence of GCD?
>
>NSOperationQueue exists at a higher conceptual level than GCD. You can
>observe the status of NSOperations, add completion handlers or drive
>multiple blocks with one operation, set priority and ordering
>restrictions on them, limit the number of operations executing
>concurrently on an NSOperationQueue, and cancel in-flight operations.
>
>On iOS, NSOperationQueue doesn't use GCD at all. On Mac OS X 10.6 and
>greater, block-based NSOperations are submitted to global
>(asynchronous) dispatch queue.
Very useful; thanks to all who responded. m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 5! http://shop.oreilly.com/product/0636920023562.do
_______________________________________________
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