title: Run multi-thread at a time and make thread to run fast
body: <p>I am trying to run two different threads at a time, but unable to do that. Thread_1 &amp; Thread_2 runs, but difference between them is around 500ms. I am not using <code>wait()</code> or <code>sleep()</code> anywhere in my code.</p>
  <p>Questions:</p>
  <ol>
  <li><p>How to make run thread simultaneously or in parallel?</p>
  </li>
  <li><p>How to make thread run fast?</p>
  </li>
  </ol>
  <p>For second question this I used <code>Thread.setPriority(Thread.MAX_PRIORITY)</code> but time difference between other is same.</p>
  <h2>Updated with example code</h2>
  <p>Doing same as below example, but takes more time between both threads to run.</p>
  <pre><code>public static void main(String args[])
  {
      MyThread thread1 = new MyThread(&quot;thread1: &quot;);
      MyThread thread2 = new MyThread(&quot;thread2: &quot;);
      thread1.start();
      thread2.start();
      boolean thread1IsAlive = true;
      boolean thread2IsAlive = true;
      do {
         if (thread1IsAlive &amp;&amp; !thread1.isAlive()) {
             thread1IsAlive = false;
              System.out.println(&quot;Thread 1 is dead.&quot;);
         }
         if (thread2IsAlive &amp;&amp; !thread2.isAlive()) {
             thread2IsAlive = false;
             System.out.println(&quot;Thread 2 is dead.&quot;);
         }
      } while(thread1IsAlive || thread2IsAlive);
  }
  </code></pre>
  <p>I have searched the web and gone through some docs. What can I try next?</p>