Use only a subset of threads in an ExecutorService
问题 In a typical JAVA application, one configures a global ExecutorService for managing a global thread pool. Lets say I configure a fixed thread pool of 100 threads: ExecutorService threadPool = Executors.newFixedThreadPool(100); Now lets say that I have a list of 1000 files to upload to a server, and for each upload I create a callable that will handle the upload of this one file. List<Callable> uploadTasks = new ArrayList<Callable>(); // Fill the list with 1000 upload tasks How can I limit the