Dispatch Work Item

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


A dispatch work item encapsulates work to be performed on a dispatch queue or within a dispatch group. You can also use a work item as a dispatch source event, registration, or cancellation handler.


Creating a Work Item


Creates a new dispatch block on the heap using an existing block and the given flags.


Creates a new dispatch block from an existing block and the given flags, and assigns it the specified quality-of-service class and relative priority.


The prototype of blocks submitted to dispatch queues, which take no arguments and have no return value.

Scheduling Work Items


Creates, synchronously executes, and releases a dispatch block from the specified block and flags.

Adding a Completion Handler


Schedules a notification block to be submitted to a queue when the execution of a specified dispatch block has completed.

Delaying Execution of a Work Item


Waits synchronously until execution of the specified dispatch block has completed or until the specified timeout has elapsed.

Canceling a Work Item


Cancels the specified dispatch block asynchronously.


Tests whether the given dispatch block has been canceled.

See Also

Queues and Tasks


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


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 Group

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