GCD(三)-dispatch_async

文档解释:Submits a block for asynchronous execution on a dispatch queue and returns immediately.
提一段需要异步操作的代码块到一个分发队列上.立即返回.异步执行.

Parameters:
queue
The queue on which to submit the block. The queue is retained by the system until the block has run to completion. This parameter cannot be NULL.
block
The block to submit to the target dispatch queue. This function performs Block_copy and Block_release on behalf of callers. This parameter cannot be NULL.
这个函数代表 调用者 执行了 Block_copy 和Block_release

讨论:
This function is the fundamental mechanism for submitting blocks to a dispatch queue. Calls to this function always return immediately after the block has been submitted and never wait for the block to be invoked. The target queue determines whether the block is invoked serially or concurrently with respect to other blocks submitted to that same queue. Independent serial queues are processed concurrently with respect to each other.
这个函数是提交block快代码到分发队列的基本途径. 这个函数永远都是异步调用.立即返回.
至于是并发执行还是串行执行.是由这些块代码提交到的队列的类型决定的.
单独的串行队列也是并发处理这些块代码的.

你可能感兴趣的:(GCD(三)-dispatch_async)