Grand Central Dispatch

Just like our hypothetical robot has lists of tasks to do with its hands, tasks to do with its voice, and so on, iOS has “lists” of tasks to be performed. They’re called queues, and are part of a work-dispatching system called Grand Central Dispatch, or GCD. The idea of GCD is that there are multiple queues of work, each with tasks to execute. The tasks are C function calls, Objective-C blocks, or Swift closures. GCD can determine which tasks to execute based on the priority of the queue, whether the tasks are suitable for concurrent execution, how busy the CPU cores are, and other considerations.

Developers from other platforms will see an analogy to threading, and the queues are indeed performed by threads, but the difference ...

Get iOS 9 SDK Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.