Contents

dispatch_async_f

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

Declaration

extern void dispatch_async_f(dispatch_queue_t queue, void *context, dispatch_function_t work);

Parameters

  • queue:

    The queue on which to submit the function. The system retains the queue until the function runs to completion. This parameter cannot be NULL.

  • context:

    The app-defined context parameter to pass to the function.

  • work:

    The app-defined function to invoke on the target queue. The first parameter passed to this function is the value of the context parameter. This parameter cannot be NULL.

Discussion

This function is the fundamental mechanism for submitting app-defined functions to a dispatch queue. Calls to this function always return immediately after the function is submitted and never wait for it to be invoked. The target queue determines whether the function is invoked serially or concurrently with respect to other tasks submitted to that same queue. Serial queues are processed concurrently with respect to each other.

See Also

Executing Tasks Asynchronously