2 comments

[ 3.1 ms ] story [ 10.7 ms ] thread
When would you want to block as you insert tasks into an ExecutorService already executing N concurrent tasks? Why not use "newFixedThreadPool" and don't block but stil keep a maximum of N concurrent tasks? Honest question, not snarky.
This can be used when you have limited resources like cpus and you want only a limited set of resource intensive tasks executing at any particular point of time..