Returns the serial dispatch queue associated with the application’s main thread.


dispatch_queue_main_t dispatch_get_main_queue(void);

Return Value

Returns the main queue. This queue is created automatically on behalf of the main thread before main is called.


The system automatically creates the main queue and associates it with your application’s main thread. Your app uses one (and only one) of the following three approaches to invoke blocks submitted to the main queue:

As with the global concurrent queues, calls to dispatch_suspend, dispatch_resume, dispatch_set_context, and the like have no effect when used with queues returned by this function.

See Also

Queues and Tasks


Returns a system-defined global concurrent queue with the specified quality-of-service class.

Dispatch Queue

An object that manages the execution of tasks serially or concurrently on your app's main thread or on a background thread.

Dispatch Work Item

The work you want to perform, encapsulated in a way that lets you attach a completion handle or execution dependencies.

Dispatch Group

A group of tasks that you monitor as a single unit.