Is there a way to know when all the processes started by my main java program has finished execution?
<p>I have to do a benchmarking for performance difference between multi-threaded and multi-process architecture in java. This is the code i used to create new process</p>

<pre><code>         for(int i=0;i&lt;100;i++)
          {
            try {
                Process p = Runtime.getRuntime().exec("java -jar myjar.jar " + input);
            } catch (Exception e) {
                System.out.println("Exception in creating process");
                e.printStackTrace();
            }
          }
</code></pre>

<p>Is there a way to know when all the processes started by my main java program has finished execution?</p>
