PHP中文网2017-04-18 10:49:13
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.
大家讲道理2017-04-18 10:49:13
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.