Function

dispatch_async_f

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

Declaration

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 queue is retained by the system until the function has run to completion. This parameter cannot be NULL.

context

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

work

The application-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 application-defined functions to a dispatch queue. Calls to this function always return immediately after the function has been 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

dispatch_async

Submits a block for asynchronous execution on a dispatch queue and returns immediately.

dispatch_after

Enqueues a block for execution at the specified time.

dispatch_after_f

Enqueues an application-defined function for execution at the specified time.

dispatch_function_t

The prototype of functions submitted to dispatch queues.

dispatch_block_t

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

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