humancode.us

An Introduction to Grand Central Dispatch

July 28, 2014

GCD Logo

Grand Central Dispatch is an important system library introduced in OS X 10.6 and iOS 4. It provides a set of C API that makes it easy(er) to deal with parallel programming on iOS and OS X. GCD works with C, C++, Objective C, and even Swift.

When you begin exploring GCD, you discover two things right away: its API is terse, and there is hardly anything in the way of introductory materials. Wouldn’t it be nice if there were a gentle introduction to guide you through some basic patterns that you should use or avoid?

That’s what this series of posts is intended to do. I’ve been using GCD since its early days, and I have battle scars to prove it. I hope I can act as a guide to this powerful and elegant library.

Over the next few weeks, I will post several blog posts that deal with aspects of GCD to help you get started, get comfortable, and get creative with the API.

I will be tagging the posts in this series with #libdispatch.

Posts in this series:

  1. Why GCD?
  2. Using GCD Queues For Synchronization
  3. GCD Concurrent Queues
  4. GCD Target Queues
  5. Writing Thread-Safe Classes with GCD
  6. Keeping Things Straight with GCD