There are two useful functions in the Java's Thread class, Sleep and Yield, Sleep is a certain time of thread sleep, that is, the CPU is handed over, and Yield is used to hint the system to hand over the CPU control. These two functions are particularly useful when multi-threaded development, which can be assigned a CPU to improve the running efficiency of the program. For Sleep, there is a usage that can replace the Yield function - Sleep (0). Calling this function is also equivalent to telling the CPU to hand over the control of the CPU. In C / C , there is also a SLEEP function (Windows called Sleep, Unix snleep), and you can also use Sleep (0) usage to hand over the control of the CPU. This mechanism is added in the appropriate place in the code. When the system burden is more important, the allocated CPU time can be balanced, and when the system is small, it does not affect the normal operation of the program. To give a simple example, two sets of simple procedures are used in C and Java, divided into group A and Group B. Group A: C : #include