title: executing parallel task in a java method
body: <p>I'm quite new to parallel programming in java. I wrote two methods that each operate on a set of data in parallel. Method A has to complete before Method B starts. I would like to know when the method executing parallel Tasks terminates. Is it:</p>
  
  <ul>
  <li>when all tasks finish execution? or </li>
  <li>After all tasks are submitted for execution.</li>
  </ul>
  
  <p><strong>NB:</strong> I have monitored the Threads with java visualVM and i realized the threads spends most of the time in the state monitor and waiting.</p>