title: Implementing threads/callable adds 50% to my execution time, why is this?
body: <p>I'm currently learning multithreading, but I have some problems understanding what's going wrong in my code.</p>
  <p>I'm trying to fill two lists with random data by calling my function <code>threadPopulateList()</code>. In my understanding, this should start two threads in parallel, as I call the method twice.</p>
  <p>But, my execution time goes up by ~50% when using the <code>threadmethod</code>.</p>
  <p>Code:</p>
  <pre><code>public class Main {
  
  
  public static void main(String[] args) throws IOException, ExecutionException, InterruptedException {
      long start=System.currentTimeMillis();
  
      /**Populate lists after eachother gives --&gt; 4211 ms */
      //        List&lt;DATA&gt;list1normal = populateNormal(9999999);
      //        List&lt;DATA&gt;list2normal = populateNormal(9999999);
  
      /**Populate list simoultaniously/parralel --&gt; 6500ms???*/
      List&lt;DATA&gt;list1normal = threadPopulateList(9999999);
      List&lt;DATA&gt;list2normal = threadPopulateList(9999999);
  
      long stop = System.currentTimeMillis();
      long executionTime = stop-start;
      System.out.println(executionTime+&quot; ms&quot;);
  
  }
  
  /**Method to populate list*/
  static List&lt;DATA&gt; populateNormal(int amount){
      List&lt;DATA&gt;data = new ArrayList&lt;&gt;();
      Random rn = new Random();
      for (int i = 0; i &lt; amount; i++) {
          data.add(new DATA(rn.nextInt(1000),rn.nextInt(1000), rn.nextInt(1000)));
      }
      return data;
  }
  
  /**Method to start a thread for each call so list will populate simoultiously*/
  static List&lt;DATA&gt; threadPopulateList(int amount) throws InterruptedException, ExecutionException {
      ExecutorService executor = Executors.newFixedThreadPool(2);
      List&lt;DATA&gt; data = new ArrayList&lt;&gt;();
      Random rn = new Random();
      Callable&lt;List&lt;DATA&gt;&gt; callable = () -&gt; {
          for (int i = 0; i &lt; amount; i++) {
              data.add(new DATA(rn.nextInt(1000), rn.nextInt(1000), rn.nextInt(1000)));
          }
          return data;
      };
      Future&lt;List&lt;DATA&gt;&gt; result = executor.submit(callable);
      executor.shutdown();
      return result.get();
     }
  }
  </code></pre>