2019年4月20日

摘要: _dispatch_main_q也就是主要主队列,一定运行在主线程里。 // 6618342 Contact the team that owns the Instrument DTrace probe before renaming this symbolstruct dispatch_queue_s _dispatch_main_q = { .do_vtable = &_dispatc... 阅读全文
posted @ 2019-04-20 12:50 花老🐯 阅读(337) 评论(0) 推荐(0) 编辑
摘要:  阅读全文
posted @ 2019-04-20 12:49 花老🐯 阅读(109) 评论(0) 推荐(0) 编辑
摘要:  阅读全文
posted @ 2019-04-20 12:49 花老🐯 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 可以看到,在queue里的任务,不仅仅是一个函数,也可以是一个其他的queue。 下面是一个例子。全局队列的处理一般一个全局队列有多个线程,这些个线程会遍历并处理链表里的任务。对于全局队列,当一个任务被抛进来后,会尽快处理掉。如果有空闲线程,那么这个空闲线程会处理这个任务。如果没有空闲线程,那么会新开一个线程来处理。 空闲线程来自哪里呢? do { _dispatch_... 阅读全文
posted @ 2019-04-20 11:10 花老🐯 阅读(368) 评论(0) 推荐(0) 编辑
摘要: Dispatch 源代码版本是libdispatch-84.5.5会根据这个结构来分析dispatch_queue 对应的代码实现参考GCD源码分析3 —— dispatch_queue篇深入浅出GCD之dispatch_queuelibdispatch-84.5.tar.gz 阅读全文
posted @ 2019-04-20 09:30 花老🐯 阅读(149) 评论(0) 推荐(0) 编辑

导航