当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - 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...

网友答案:

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.

网友答案:

NSOperationQueue does use GCD. From the documentation:

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: