Java: Do Thread pools execute tasks simultaneously or sequentially?
<p>My understanding of thread pool is that that when you pass a thread pool a method it picks a thread from its active pool and sends the method off to be executed. My understanding of a thread is that if you put some code in it, it will run through the code without stopping until it is told to sleep or stop.</p>

<p>My question:</p>

<p>When you pass several methods (of roughly equal length to execute) to a thread pool one after another does the thread pool manage sharing between the different threads being executed so that the tasks finish almost simultaneously or does it execute them one after another - for example, task 1 goes into thread 1, thread 1 starts executing it and thread 2 with task 2 in it hasn't had a chance to run until task task 1 has finished because thread 1 was running through the code it has been given without any explicit messages to sleep - so then thread 2 will execute and the tasks will essentially finish one after another.</p>

<p><strong>Basically, do I have to explicitly make sure the code I give to a thread pool has a breaks in it for the threads to run simultaneously? Or do I get this for free when using a thread pool manager?</strong></p>
