随笔分类 -  GCD

摘要:两件事情: 1、是否是一个线程; 2、queue task 的目标线程是否有未完成的task。 模型:一个线程处理当前的task还有通过gc d派发来的待执行task。 猜测: 如果目标thread上除了当前task,没有其它的task,派发到thread task 可以 优化为直接执行。 如果有其 阅读全文
posted @ 2018-06-12 21:52 zzfx 阅读(61) 评论(0) 推荐(0) 编辑
摘要:Dispatch Queues and Thread Safety It might seem odd to talk about thread safety in the context of dispatch queues, but thread safety is still a releva 阅读全文
posted @ 2018-06-12 18:00 zzfx 阅读(151) 评论(0) 推荐(0) 编辑
摘要:GCD 可以看作是集合类的操作; 集合是queue,元素是block; 集合只能添加对象,删除对象由系统完成。 同理,NSOperationQueue也可以看作是一个集合管理器。 dispatch_group A dispatch group is a mechanism for monitorin 阅读全文
posted @ 2018-04-12 19:22 zzfx 阅读(176) 评论(0) 推荐(0) 编辑
摘要:queue相当于事件处理机制里的事件池;只是任务池; 线程作为事件处理的实施者,由线程池从任务池中获取任务进行调度派发; group相当与工作组,按照任务的相关性对任务进行组织。 阅读全文
posted @ 2018-01-28 00:52 zzfx 阅读(180) 评论(0) 推荐(0) 编辑
摘要:Grand Central Dispatch (GCD) is a technology developed by Apple Inc. to optimize application support for systems with multi-core processors and other  阅读全文
posted @ 2018-01-18 23:51 zzfx 阅读(197) 评论(0) 推荐(0) 编辑
摘要:Concurrency and Application Design In the early days of computing, the maximum amount of work per unit of time that a computer could perform was deter 阅读全文
posted @ 2017-12-11 19:21 zzfx 阅读(136) 评论(0) 推荐(0) 编辑
摘要:https://developer.apple.com/library/content/documentation/General/Conceptual/ConcurrencyProgrammingGuide/OperationQueues/OperationQueues.html#//apple_ 阅读全文
posted @ 2017-04-19 17:22 zzfx 阅读(205) 评论(0) 推荐(0) 编辑