sleep sell cpu time

wait () releases the lock
sleep () does not release the lock, so that the cpu time
sleep (3000) is not necessarily carried out in three seconds after
sleep (0), preemptive, this operation will trigger the operating system immediately re-assigned java thread once CPU competition, re-calculate the priority, so that some low-priority threads can get to the cpu control, same reason sleep () operation is to bring out the cpu time

Guess you like

Origin www.cnblogs.com/youmingDDD/p/11288029.html