开发者

Many NSOperationQueues = Many Threads?

开发者 https://www.devze.com 2023-04-12 06:10 出处:网络
I\'m wondering would there be many threads if I hav开发者_如何学运维e one NSOperationQueue in each of my View Controllers, that is, I have many NSOperationQueues in my app.

I'm wondering would there be many threads if I hav开发者_如何学运维e one NSOperationQueue in each of my View Controllers, that is, I have many NSOperationQueues in my app.

Thank you.


Every NSOperationQueue, when running, its execution of the current NSOperation is on a separate thread.

If you've called -setMaxConcurrentOperationCount: passing in 1, then you're guaranteed to only have one NSOperation running in the queue at any given time. (i.e. a serial queue.)

Otherwise, your NSOperationQueue could have as many as NSOperationQueueDefaultMaxConcurrentOperationCount threads running at any given time.

0

精彩评论

暂无评论...
验证码 换一张
取 消