title: What's the difference between Thread.yield() and Thread.sleep(0) in Java?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1600572/are-thread-sleep0-and-thread-yield-statements-equivalent">Are Thread.sleep(0) and Thread.yield() statements equivalent?</a>  </p>
  </blockquote>
  
  
  
  <p>In my understanding, both Thread.yield() and Thread.sleep(0) should make the CPU rejudge which thread to run by some scheduling algorithm.</p>
  
  <p>The difference is:</p>
  
  <ol>
  <li><p>Thread.yield() is to give the executive chance to other threads, but Thread.sleep(0) will not, it'll just tell CPU that you should rearrange the executive threads including the current thread itself.</p></li>
  <li><p>Thread.yield() is just an advice which means it may not be accepted at all, but Thread.sleep(0) will do the rearrangement forcedly.</p></li>
  </ol>
  
  <p>Are the two above conclusions right?</p>