user572479
user572479

Reputation: 31

NSOperationQueue and concurrent operation

As the NSOperationQueue Class Reference said: In iOS, operation queues do not use Grand Central Dispatch to execute operations. They create separate threads for non-concurrent operations and launch concurrent operations from the current thread.

But I found in iOS 4.2.1,queue always create threads for concurrent or non-concurrent operations. And I think queue don't care concurrent or non-concurrent at all, because a breakpoint in isConcurrent never be broken. So I think the Reference was wrong...

Upvotes: 3

Views: 927

Answers (2)

Jonathan Grynspan
Jonathan Grynspan

Reputation: 43472

NSOperationQueue does use GCD. From the documentation:

In iOS 4 and later, operation queues use Grand Central Dispatch to execute operations.

Upvotes: 0

David Beck
David Beck

Reputation: 10159

If you look at the documentation for NSOperation, you should see a note about Mac 10.6 (which roughly corresponds to iOS 4.0) ignoring isConcurrent.

Basically, the only reason to create a concurrent NSOperation would be if you were going to fire it manually.

Upvotes: 2

Related Questions