title: Is it a good way to use java.util.concurrent.FutureTask?
body: <p>First of all, I must say that I am quite new to the API java.util.concurrent, so maybe what I am doing is completely wrong.</p>
  
  <p>What do I want to do?</p>
  
  <p>I have a Java application that basically runs 2 separate processing (called <em>myFirstProcess</em>, <em>mySecondProcess</em>), but these processing must be run at the same time.</p>
  
  <p>So, I tried to do that:</p>
  
  <pre><code>public void startMyApplication() {
      ExecutorService executor = Executors.newFixedThreadPool(2);
      FutureTask&lt;Object&gt; futureOne = new FutureTask&lt;Object&gt;(myFirstProcess);
      FutureTask&lt;Object&gt; futureTwo = new FutureTask&lt;Object&gt;(mySecondProcess);
      executor.execute(futureOne);
      executor.execute(futureTwo);
      while (!(futureOne.isDone() &amp;&amp; futureTwo.isDone())) {
          try {
              // I wait until both processes are finished.
              Thread.sleep(1000);
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
      }
      logger.info("Processing finished");
      executor.shutdown();
      // Do some processing on results
      ...
  }
  </code></pre>
  
  <p><em>myFirstProcess</em> and <em>mySecondProcess</em> are classes that implements <code>Callable&lt;Object&gt;</code>, and where all their processing is made in the call() method.</p>
  
  <p>It is working quite well but I am not sure that it is the correct way to do that.
  Is a good way to do what I want? If not, can you give me some hints to enhance my code (and still keep it as simple as possible).</p>