title: what does jvm do to use multicore cpu resource?
body: <p>Usually a java program is running with a single process called "javaw".And when I run a single process I can only get max resource of one core(of multicores).
  But when I run a multithread program in jvm, the number of cores it used is according to the number of threads which is beyond one process can do. So can anyone give me some information about how jvm deal with multithread program in multicore cpu machine ?</p>
  
  <pre><code>/**
  * I run this program in my machine which has 8 core cpu
  * and the jre is 1.6.0_24
  * How does jvm use one process to use all the cpu resources?        
  */
  
  public class MultiCoreUseTest implements Runnable{
  @Override
  public void run() {
  
      int i;
      while(true)
           i =1;
  }
  
  public static void main(String[] args) {
  
      //create 8 threads
              //8 threads the usage of cpu is 100%
              // if 4 threads the usage of cpu is 50%
      for(int i = 0; i&lt;8; i++){
          new Thread(new MultiCoreUseTest()).start();     
      }
  }
  
  }
  </code></pre>