Type Alias

dispatch_queue_t

A lightweight object to which your application submits blocks for subsequent execution.

Declaration

typedef NSObject<OS_dispatch_queue> *dispatch_queue_t;

Discussion

A dispatch queue invokes blocks submitted to it serially in FIFO order. A serial queue invokes only one block at a time, but independent queues may each invoke their blocks concurrently with respect to each other.

The global concurrent queues invoke blocks in FIFO order but do not wait for their completion, allowing multiple blocks to be invoked concurrently.

The system manages a pool of threads that process dispatch queues and invoke blocks submitted to them. Conceptually, a dispatch queue may have its own thread of execution, and interaction between queues is highly asynchronous.

Dispatch queues are reference counted via calls to dispatch_retain and dispatch_release. Pending blocks submitted to a queue also hold a reference to the queue until they have finished. Once all references to a queue have been released, the queue will be deallocated by the system.

See Also

Creating a Dispatch Queue

dispatch_get_main_queue

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

dispatch_get_global_queue

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

dispatch_queue_create

Creates a new dispatch queue to which you can submit blocks.

dispatch_queue_create_with_target

Creates a new dispatch queue to which you can submit blocks.

DISPATCH_QUEUE_SERIAL

A dispatch queue that executes blocks serially in FIFO order.

DISPATCH_QUEUE_CONCURRENT

A dispatch queue that executes blocks concurrently.

dispatch_queue_main_t

A dispatch queue that is bound to the app's main thread and executes tasks serially on that thread.

dispatch_queue_global_t

A dispatch queue that executes tasks concurrently using threads from the global thread pool.

dispatch_queue_serial_t

A dispatch queue that executes tasks serially in first-in, first-out (FIFO) order.

dispatch_queue_concurrent_t

A dispatch queue that executes tasks concurrently and in any order, respecting any barriers that may be in place.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software