*** Welcome to piglix ***

Grand Central Dispatch

Grand Central Dispatch
GCD
Developer(s) Apple Inc.
Operating system Mac OS X 10.6 (2009) and later, iOS 4.0 and later,FreeBSD
Type System Utility
License Apache 2.0
Website https://libdispatch.macosforge.org

Grand Central Dispatch (GCD) is a technology developed by Apple Inc. to optimize application support for systems with multi-core processors and other symmetric multiprocessing systems. 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.

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. It has been ported to the FreeBSD operating system, starting with FreeBSD 8.1.MidnightBSD 0.3-CURRENT includes "libdispatch" without blocks support. Linux and Solaris support are provided within the upstream trunk. In order to develop support for Windows, currently two forks exist at opensource.mlba-team.de and GitHub. Apple has its own port of libdispatch.dll for Windows shipped with Safari and iTunes, but no SDK is provided.

GCD works by allowing specific tasks in a program that can be run in parallel to be queued up for execution and, depending on availability of processing resources, scheduling them to execute on any of the available processor cores (referred to as "routing" by Apple).

A task can be expressed either as a function or as a "block." Blocks are an extension to the syntax of C, C++, and Objective-C programming languages that encapsulate code and data into a single object in a way similar to a closure. GCD can still be used in environments where blocks are not available.


...
Wikipedia

...