问十九: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:自由的

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

猜你喜欢

转载自blog.csdn.net/qq_18657175/article/details/89762572
今日推荐