首页 > 其他 > 详细

dispatch_sync:As an optimization, this function invokes the block on the current thread when possible

时间:2018-06-12 22:18:26      阅读:180      评论:0      收藏:0      [点我收藏+]

两件事情:

1、是否是一个线程;

2、queue task 的目标线程是否有未完成的task。

 

模型:一个线程处理当前的task还有通过gc d派发来的待执行task。

 

猜测:

如果目标thread上除了当前task,没有其它的task,派发到thread task 可以 优化为直接执行。

如果有其它待执行task,则会导致死锁。

dispatch_sync:As an optimization, this function invokes the block on the current thread when possible

原文:https://www.cnblogs.com/feng9exe/p/9175227.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!