Multi-threaded programming methods of -Thread

run (): the program is and will be, and other threads "simultaneously" section to perform.
 
wait (): makes the current thread into a wait state, waiting threads will not take the initiative into the thread queue waiting cpu resources, it must be called by another thread notify () method notifies it.
 
interrupt (): wake sleeping threads.
 
yield (): After calling this method, the thread is in the ready state.
 
join (): mainly used for synchronization, so that the parallel execution between the threads into the serial execution.
More than two / thread to unite must be thread has been started, if not a start, is not united.

join the realization of the principle:

 

Guess you like

Origin www.cnblogs.com/wzdnwyyu/p/11057566.html