ThreadPoolExecutor and many new threads during runtime
I am using the ThreadPoolExecutor to run a lot of threads depending on the processor count. Everything is working fine.
But during runtime (when the threads are still running) I would like to generate new work and queue them so they can be executed when the older threads are done.
So basically I would like to feed new work to the ThreadPoolExecutor when the pool runs low on work. So there are always 40-100 queued task and the threadpool executor is always busy.
I would be so happy if anyone has an idea how to do that.
Cheers to all,