How do I execute multiple processes simultaneously in Java?
<p>I am working on an application in which I want multiple tasks to be executed simultaneously.</p>

<p>I also want to be able to keep track of the number of such tasks being run in parallel, and sometimes add yet another task to be processed in parallel, in addition to the current set of tasks already being processed.</p>

<p>One more thing- I want to do the above, not only in a desktop app, but also in a cloud app, in which I initialise another virtual machine running Tomcat, and then repeat all of the above in that instance.</p>

<p>What is the best way to do this? If you can point me to the correct theory/guides on this subject, that would be great, although code samples are also welcome.</p>
