title: java.util.concurrent.Future.get() not returning
body: <p>I have the following Java code:</p>
  
  <pre><code>final Future future = exeService.submit(
      new Runnable() {
          public void run() {
              myObject.doSomething();
          }
      }
  );
  
  future.get();
  </code></pre>
  
  <p>where <code>exeService</code> is an instance of </p>
  
  <pre><code>java.util.concurrent.ExecutorService
  </code></pre>
  
  <p>The problem is that <code>myObject.doSomething()</code> never returns, and, hence, <code>future.get()</code> never returns.</p>
  
  <p>However, if I replace the call to <code>submit</code> with a call to <code>execute</code> like this:</p>
  
  <pre><code>exeService.execute(
      new Runnable() {
          public void run() {
              myObject.doSomething();
          }
      }
  );
  </code></pre>
  
  <p>the call to <code>myObject.doSomething()</code> does return.  I don't know if it matters, but <code>doSomething()</code> is a <code>void</code> method.</p>
  
  <p>Why is <code>doSomething()</code> finishing when using <code>execute</code> but not when using <code>submit</code>?</p>
  
  <p>Also, I don't need to use <code>Future.get()</code>; that just seemed to be the most natural way of doing this.  (I also run into the same problem with <code>CountdownLatch</code>.)  The point is that I need to wait for <code>doSomething()</code> to finish before proceeding, and, for complicated reasons I won't go into here, I need to launch it on a separate thread.  If there is another way of doing this that works, that would be fine.</p>