Better to use global or custom GCD queues?

I understand that // 001 gets a parallel high priority queue

 // 001 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); 

and that // 002 creates a new custom sequential queue

 // 002 dispatch_queue_t queue = dispatch_queue_create("bgQueue", NULL); 

My question is: is there any chance that other processes (on the iPhone, other applications, etc.) will be queued in global queues, so you will have to wait (albeit not for long) to execute. If so, it would be better to always create custom queues, where do you know that you have only access?

+4
source share
2 answers
  • 001 receives the priority queue, but does not create it. Three global queues are automatically created for your application; they are always available.
  • Three global queues are global only within your application, in the same sense that global variables are global. These queues are still private for each application in which they are created.
  • The main difference between a private and a global queue is that it is used so that the private queues are sequential and the global queues are parallel. The differences between them are shown in Table 3-1 of the GCD documentation . EDIT: On OS X v10.7 and later, private queues can now also be parallel by passing DISPATCH_QUEUE_CONCURRENT (thanks Rob, for fixing).
+8
source

On platforms where private queues can be at the same time (Lion or later), what is the difference using global queues and private queues?

0
source

Source: https://habr.com/ru/post/1432324/


All Articles