问十九:yield函数的作用?

* A hint to the scheduler that the current  thread is willing to yield

* its current use of a processor. The scheduler  is free to ignore this

* hint.

hint:暗示

scheduler:调度器

yield:退让,让出

is free to:自由的

 

当前线程会给调度器一个提示,说明它可以让出当前正在使用的处理器资源调度器自由选择是否忽略这个暗示(就是提醒一下调度器,我可以让出资源了,你要不要。调度器视情况而定,要不要取消掉当前线程的资源占用)

全部评论

相关推荐

LastWh1spe...:ssob真有些人和那个没睡醒一样
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务