http://stackoverflow.com/questions/25052629/ios-gcd-difference-between-any-global-queue-and-the-one-with-background-priorit
- DISPATCH_QUEUE_PRIORITY_HIGH
- DISPATCH_QUEUE_PRIORITY_DEFAULT
- DISPATCH_QUEUE_PRIORITY_LOW
are priority queues with tasks in them.
These queues are performed according to their priority as evident by their names.
Let’s say you have the queue with HIGH priority; tasks in that queue will be executed first; you would do that if one specific task needs to be finished as quick as possible even if it means that other tasks are delayed.
DISPATCH_QUEUE_PRIORITY_LOW – Items dispatched to the queue will run at low priority, i.e. the queue will be scheduled for execution after ALL default priority and high priority queues have been scheduled.
DISPATCH_QUEUE_PRIORITY_BACKGROUND
Let’s say you may have a task A that takes a long time, but it is Ok for that task to wait for other tasks to finish. For example, if there is work to do at NORMAL priority, that work will be done first, and only when there is a spare CPU doing nothing else, then your task A will be performed.
You would give that task A BACKGROUND priority.
Meaning of Global Queue
Other things, like system frameworks, may be scheduling in to it. It’s very easy to starve the priority bands – if there are a lot of DISPATCH_QUEUE_PRIORITY_HIGH tasks being scheduled, tasks at the default priority may have to wait quite a while before executing. And tasks in DISPATCH_QUEUE_PRIORITY_BACKGROUND may have to wait a very long time, as all other priorities above them must be empty.
Don’t abuse the global queue
A lot of developers abuse the global concurrent queue. They want a execute a block, need a queue, and just use that at the default priority. That kind of practice can lead to some very difficult to troubleshoot bugs. The global concurrent queue is a shared resource and should be treated with care. In most cases it makes more sense to create a private queue.
ref – http://stackoverflow.com/questions/9602042/whats-the-difference-between-the-global-queue-and-the-main-queue-in-gcd
thread priorities
-main- : 0.758065
DISPATCH_QUEUE_PRIORITY_HIGH : 0.532258
DISPATCH_QUEUE_PRIORITY_DEFAULT : 0.500000
DISPATCH_QUEUE_PRIORITY_LOW : 0.467742
DISPATCH_QUEUE_PRIORITY_BACKGROUND : 0.000000