I know I can specify the Fixed Thread Pool Size using
ExecutorService executor = Executors.newFixedThreadPool(10);
I can add runnable objects into the executor and they execute whenever a thread is free in the pool
executor.execute(Obj);
I want to limit the no of objects to be added to the executor service
i.e. if I have 100 runnable objects, the Thread Pool Size is 10 and only 20 must be added to the ExecutorService and rest must be rejected.
I want to create a fixed size waiting list for the executor
so that instead of adding all 100 objects and keeping them in wait state, it must just keep a fixed no of items in waiting state
I went through the Executor and ExecutorService API, but didn't find any such thing, just wanted to know if this is possible ?