5a31e70353
This is now considering only threads waiting for the queue to get new tasks as idle. The thread pool maintained a counter of active threads, but that counter was increased too late in the beforeExecute method. Submitting a task created a new thread. If now a second task was submitter before the new thread had started to execute it's task, the second task was queued without creating a 2nd thread. So the second task was only executed after the first task had been completed - even if the thread pool's maximum number of thread had not been reached. This fix now maintains the delta between the number those threads that are currently waiting in the queue's poll or take methods as idle threads, and the number of queued tasks. It creates new threads unless there are enough idle threads to pick up all queued tasks. This closes #1144 |
||
---|---|---|
.. | ||
src | ||
pom.xml |