title: Multithread imbalance Java
body: <p>This is the code for my thread test.</p>
  
  <pre><code>class TestThread extends Thread {   
      @Override
      public void run() {
          while (true) {
              System.out.println("Run thread "+this.getId());
              try {
                  Thread.sleep(10000);
              } catch (InterruptedException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
          }
      }
  }
  </code></pre>
  
  <p>In the main function, I set up 100 threads:</p>
  
  <pre><code>for (int i = 0; i &lt; 100; i++) {
      TestThread tt = new TestThread();
      tt.run();
  }
  </code></pre>
  
  <p>And this is the result I got</p>
  
  <pre><code>Run thread 8
  Run thread 8
  Run thread 8
  Run thread 8
  ...
  </code></pre>
  
  <p>Why only thread 8 printed out? It seems that this is the only thread that is running. How can I make other threads work?</p>