title: Why does “while(true)” without “Thread.sleep” cause 100% CPU usage on Linux but not on Windows?
body: <p>I have created a simple program in java:</p>
  
  <pre><code>public static void main(String[] args) throws InterruptedException {
      while (true) 
          ;
  }
  </code></pre>
  
  <p>If I run this on a Linux machine, it shows 100% CPU usage, but doesn't cause the OS to appear slow.  However, if I run the exact same code on Windows, it only shows about 20% CPU usage.</p>
  
  <p>I am using Oracle JRE on Windows and OpenJDK 6 on Linux.</p>
  
  <p>I'm wondering if Windows' scheduler preempt threads randomly and Linux's doesn't?</p>