Queues and Threads

Before GCD, it was possible to use multiple threads on a multicore system, but it was a somewhat complex process. The complexity arose from the fact that software engineers basically had to construct their own threading mechanism, sometimes even modifying it depending on the number of cores in the processor running the app. This complexity didn’t cause too many problems because multicore processors were not in widespread use. However, the trend was clear, so Apple developed GCD to allow people to use threads for multicore processing.

There are two abstractions at the heart of GCD:

Image A thread is a sequence of instructions that ...

Get Learning iCloud Data Management: A Hands-On Guide to Structuring Data for iOS and OS X 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.