GCD uses queues to manage blocks of work in a multithreaded environment; queues operate on a first in first out (FIFO) policy. When GCD determines that resources are available, it will take the next block from the queue and execute it; once the block has finished executing, it will be removed from the queue:

There are two types of DispatchQueue: serial and concurrent. With the simplest form of a queue, a serial queue, GCD will only execute one block at a time from the top of the queue. When each block finishes executing, it is removed from the queue, and each block moves up one position.
The main queue, which processes all UI events, is an example of a serial queue, and this explains why performing a long-running operation on the main queue will cause your UI to become unresponsive. While your long-running operation is executing, nothing else on the main queue will be executed until the long-running operation has finished.
With the second type of queue, a concurrent queue, GCD will execute as many blocks as resources allow on different threads. The next block to execute will be the block closest to the top of the stack that isn't already executing, and blocks are removed from the stack when finished:

Concurrent queues can be really useful when you have numerous operations that are independent of each other. We will look into concurrent queues further in the next recipe.