我们可以同时在NSOperationQueue中运行的最大线程数是多少 [英] What is the maximum number of threads we can run in NSOperationQueue simultaneously

查看:220
本文介绍了我们可以同时在NSOperationQueue中运行的最大线程数是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

面试中总是被问到,我们可以在 NSOperationQueue 中并通过GCD异步在ios iphone编程中同时运行多少个最大线程?

It is always being asked in interview how many maximum threads we can run in ios iphone programming simultaneously in NSOperationQueue and through GCD async?

请解释答案。

推荐答案

创建操作时,应使用 NSOperationQueueDefaultMaxConcurrentOperationCount 操作系统决定最大操作数-它会根据可用的硬件和系统资源来决定。该数字当然会因设备而异。

You should be using NSOperationQueueDefaultMaxConcurrentOperationCount when you create your operations to let the OS decide the maximum number of operations - it will decide this based on the hardware available and system resources. The number will of course vary depending on device.

这篇关于我们可以同时在NSOperationQueue中运行的最大线程数是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆