Grand Central Dispatch

Original author(s)Dave Zarzycki
Developer(s)Apple Inc.
Written inC
Operating systemMac OS X 10.6 (2009) and later, iOS 4.0 and later,[1] watchOS, tvOS, FreeBSD
TypeSystem Utility
LicenseApache 2.0
Websitehttps://apple.github.io/swift-corelibs-libdispatch/

Grand Central Dispatch (GCD or libdispatch) is a technology developed by Apple Inc. to optimize application support for systems with multi-core processors and other symmetric multiprocessing systems.[2] It is an implementation of task parallelism based on the thread pool pattern. The fundamental idea is to move the management of the thread pool out of the hands of the developer, and closer to the operating system. The developer injects "work packages" into the pool oblivious of the pool's architecture. This model improves simplicity, portability and performance.

GCD was first released with Mac OS X 10.6, and is also available with iOS 4 and above. The name "Grand Central Dispatch" is a reference to Grand Central Terminal.[citation needed]

The source code for the library that provides the implementation of GCD's services, libdispatch, was released by Apple under the Apache License on September 10, 2009.[3] It has been ported[4] to FreeBSD 8.1+,[5] MidnightBSD 0.3+,[6] Linux, and Solaris.[7][8] Attempts in 2011 to make libdispatch work on Windows were not merged into upstream.[9][10] Apple has its own port of libdispatch.dll for Windows shipped with Safari and iTunes, but no SDK is provided.

Since around 2017, the original libdispatch repository hosted by Nick Hutchinson[11] was deprecated in favor of a version that is part of the Swift core library created in June 2016. The new version supports more platforms, notably including Windows.

  1. ^ "Grand Central Dispatch (GCD) Reference". Apple Inc.
  2. ^ Apple Previews Mac OS X Snow Leopard to Developers Archived March 18, 2012, at the Wayback Machine, June 9, 2008.
  3. ^ "Grand Central Dispatch". apple.github.io.
  4. ^ "GCD libdispatch w/Blocks support working on FreeBSD". Archived from the original on July 27, 2011. Retrieved September 28, 2009.
  5. ^ "FreeBSD Quarterly Status Report". www.freebsd.org.
  6. ^ "libdispatch". Just Journal.
  7. ^ libdispatch mailing list: "Porting status Linux" Archived July 11, 2011, at the Wayback Machine April 10, 2011
  8. ^ libdispatch mailing list: "Porting status Solaris x86/64" Archived October 4, 2011, at the Wayback Machine April 10, 2011
  9. ^ libdispatch mailing list: "libdispatch for Win32" Archived August 20, 2011, at the Wayback Machine April 22, 2011
  10. ^ libdispatch mailing list: "Updates regarding the status of libdispatch on Windows" Archived August 20, 2011, at the Wayback Machine May 5, 2011
  11. ^ Hutchinson, Nicholas (January 10, 2020). "libdispatch". GitHub. Retrieved January 15, 2020.