java线程执行yield()后就会让出cpu ,那之后如何恢复啊?
ringa_lee
ringa_lee 2017-04-18 10:47:13
0
3
687

java线程执行yield()后就会让出cpu
那之后如何恢复啊?

ringa_lee
ringa_lee

ringa_lee

reply all(3)
洪涛

Yield is not sure to give up the CPU, and does not need to be restored, just wait for scheduling. This method is generally rarely used.

小葫芦

Thanks for correcting me
I misremembered

大家讲道理

Wait for the thread scheduler to allocate CPU time slices to you later. But calling the yield method is just a suggestion, telling the thread scheduler that my work is almost done and that other threads of the same priority can use the CPU. There is no mechanism to guarantee adoption.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template