Grand Central Dispatch

[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.

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.

"[15] 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.

[12] A task in Grand Central Dispatch can be used either to create a work item that is placed in a queue or assign it to an event source.

[17] Two examples that demonstrate the use of Grand Central Dispatch can be found in John Siracusa's Ars Technica Snow Leopard review.

Normally, this would be a quick process, and may be executed in the main thread without the user noticing a delay between pressing a button and the results showing.

If the document is large and analysis takes a long time to execute then the main thread will wait for the function to finish.

This will allow the OS to spread out the work as it sees fit, choosing the optimal number of threads to run on for the current hardware and system load.

Apple has changed the interface since its inception (in OS X 10.5) through the official launch of GCD (10.6), Mountain Lion (10.8) and Mavericks (10.9).