wait()和notifyAll()是在線程同步的時候使用的一對方法。yield()通常而言你不會用到。一下來自Java API
It is rarely appropriate to use this method. It may be useful for debugging or testing purposes, where it may help to reproduce bugs due to race conditions. It may also be useful when designing concurrency control constructs such as the ones in the?java.util.concurrent.locks?package.
2015-05-21
wait()和notifyAll()是在線程同步的時候使用的一對方法。yield()通常而言你不會用到。一下來自Java API
It is rarely appropriate to use this method. It may be useful for debugging or testing purposes, where it may help to reproduce bugs due to race conditions. It may also be useful when designing concurrency control constructs such as the ones in the?java.util.concurrent.locks?package.