04 2019 档案

Dispatch Queue 之内存中常驻的几个结构
摘要:_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 花老🐯 阅读(352) 评论(0) 推荐(0) 编辑

Dispatch Queue 之 dispatch_sync
摘要: 阅读全文

posted @ 2019-04-20 12:49 花老🐯 阅读(112) 评论(0) 推荐(0) 编辑

Dispatch Queue 之 Invoke 当前队列
摘要: 阅读全文

posted @ 2019-04-20 12:49 花老🐯 阅读(111) 评论(0) 推荐(0) 编辑

Dispatch Queue 之 dispatch_async
摘要:可以看到,在queue里的任务,不仅仅是一个函数,也可以是一个其他的queue。 下面是一个例子。全局队列的处理一般一个全局队列有多个线程,这些个线程会遍历并处理链表里的任务。对于全局队列,当一个任务被抛进来后,会尽快处理掉。如果有空闲线程,那么这个空闲线程会处理这个任务。如果没有空闲线程,那么会新开一个线程来处理。 空闲线程来自哪里呢? do { _dispatch_... 阅读全文

posted @ 2019-04-20 11:10 花老🐯 阅读(388) 评论(0) 推荐(0) 编辑

Dispatch Queue 内存结构
摘要: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) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示