GCD Dispatch 组的并发限制是多少?

What is the concurrency limit for GCD Dispatch groups?

我一直在使用 DispatchGroup 来促进我的应用程序中的多个并发调用。

我的后端团队注意到,当我尝试进行八个并发调用时,它们被分成两批,每批四个调用。

  1. 4个并发调用是GCD的限制吗?
  2. 这是GCD框架的限制,还是取决于硬件?
  3. 有没有办法允许更多的并发调用?

来自 GCD 的参考资料:

Concurrent queues (also known as a type of global dispatch queue) execute one or more tasks concurrently, but tasks are still started in the order in which they were added to the queue. The currently executing tasks run on distinct threads that are managed by the dispatch queue. The exact number of tasks executing at any given point is variable and depends on system conditions.

系统自动(动态)决定同时执行多少个任务。除其他外,它基于电池状态、内核数量、系统负载等。

有关详细信息,请参阅 Dispatch Queues