Function

dispatch_get_global_queue

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

Declaration

dispatch_queue_global_t dispatch_get_global_queue(long identifier, unsigned long flags);

Parameters

identifier

The quality of service you want to give to tasks executed using this queue. Quality-of-service helps determine the priority given to tasks executed by the queue. You may specify the values QOS_CLASS_USER_INTERACTIVE, QOS_CLASS_USER_INITIATED, QOS_CLASS_UTILITY, or QOS_CLASS_BACKGROUND. Queues that handle user-interactive or user-initiated tasks have a higher priority than tasks meant to run in the background.

In OS X 10.9 or earlier, you can specify one of the dispatch queue priority values, which are found in Dispatch Queue Priorities. These values map to an appropriate quality-of-service class.

flags

Flags that are reserved for future use. Always specify 0 for this parameter.

Return Value

The requested global concurrent queue.

Discussion

This function returns a queue suitable for executing tasks with the specified quality-of-service level. Calls to the dispatch_suspend, dispatch_resume, and dispatch_set_context functions have no effect on the returned queues.

Tasks submitted to the returned queue are scheduled concurrently with respect to one another.

See Also

Managing Dispatch Queues

Dispatch Queue Types

Attributes to use when creating new dispatch queues.

dispatch_queue_t

A dispatch queue is a lightweight object to which your application submits blocks for subsequent execution.

dispatch_get_main_queue

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

dispatch_get_current_queue

Returns the queue on which the currently executing block is running.

Deprecated
dispatch_set_target_queue

Sets the target queue for the given object.

dispatch_async

Submits a block for asynchronous execution on a dispatch queue and returns immediately.

dispatch_async_f

Submits an application-defined function for asynchronous execution on a dispatch queue and returns immediately.

dispatch_sync_f

Submits an application-defined function for synchronous execution on a dispatch queue.

dispatch_after

Enqueue a block for execution at the specified time.

dispatch_after_f

Enqueues an application-defined function for execution at a specified time.

dispatch_apply_f

Submits an application-defined function to a dispatch queue for multiple invocations.

dispatch_queue_get_label

Returns the label specified for the queue when the queue was created.

dispatch_get_specific

Returns the value for the key associated with the current dispatch queue.

dispatch_queue_set_specific

Sets the key/value data for the specified dispatch queue.

dispatch_queue_get_specific

Gets the value for the key associated with the specified dispatch queue.

dispatch_once_t

A predicate for use with the dispatch_once function.

dispatch_once

Executes a block object once and only once for the lifetime of an application.

dispatch_once_f

Executes an application-defined function once and only once for the lifetime of an application.

dispatch_main

Executes blocks submitted to the main queue.