Function

dispatch_queue_create_with_target

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

Declaration

dispatch_queue_t dispatch_queue_create_with_target(const char *label, dispatch_queue_attr_t attr, dispatch_queue_t target);

Parameters

label

A string label to attach to the queue to uniquely identify it in debugging tools such as Instruments, sample, stackshots, and crash reports. Because applications, libraries, and frameworks can all create their own dispatch queues, a reverse-DNS naming style (com.example.myqueue) is recommended. This parameter is optional and can be NULL.

attr

The queue attributes. Specify DISPATCH_QUEUE_SERIAL (or NULL) to create a serial queue or specify DISPATCH_QUEUE_CONCURRENT to create a concurrent queue.

target

The target queue on which to execute blocks. This method retains the target queue. Specify DISPATCH_TARGET_QUEUE_DEFAULT to set the target queue to the default type for the current dispatch queue.

Return Value

The newly created dispatch queue.

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_SERIAL

A dispatch queue that executes blocks serially in FIFO order.

DISPATCH_QUEUE_CONCURRENT

A dispatch queue that executes blocks concurrently.

dispatch_queue_t

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

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.