Dispatch Objects

The basic behaviors supported by all dispatch types.

Overview

There are many types of dispatch objects, including dispatch_queue_t, dispatch_group_t, and dispatch_source_t. The base dispatch object interfaces allow you to manage memory, pause and resume execution, define object context, log task data, and more.

By default, dispatch objects are declared as Objective-C types when you build them with an Objective-C compiler. This behavior lets you adopt ARC and enable memory leak checks by the static analyzer. It also lets you add your objects to Cocoa collections.

Topics

Activating, Suspending, and Resuming the Object

dispatch_activate

Activates the dispatch object.

dispatch_suspend

Suspends the invocation of block objects on a dispatch object.

dispatch_resume

Resumes the invocation of block objects on a dispatch object.

dispatch_object_t

A dispatch object.

Changing the Assigned Target Queue

dispatch_set_target_queue

Specifies the dispatch queue on which to perform work associated with the current object.

Updating Contextual Data

dispatch_get_context

Returns the application-defined context of an object.

dispatch_set_context

Associates an application-defined context with the object.

Managing Memory

dispatch_retain

Increments the reference count (the retain count) of a dispatch object.

dispatch_release

Decrements the reference count (the retain count) of a dispatch object.

dispatch_set_finalizer_f

Sets the finalizer function for a dispatch object.