码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-06-12 22:33:43      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:possible   bsp   模型   目标   除了   直接   ble   current   thread   

两件事情:

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

标签:possible   bsp   模型   目标   除了   直接   ble   current   thread   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!