Will a ScheduledExecutorService create new threads as needed?
- by Matt Ball
I'm using Executors.newScheduledThreadPool() to create a ScheduledExecutorService, specifying the number of threads like so:
int corePoolSize = 42;
ScheduledExecutorService foo = Executors.newScheduledThreadPool(corePoolSize);
According to the JavaDocs, the corePoolSize argument sets
the number of threads to keep in the pool, even if they are idle.
Does this mean that this ExecutorService implementation may create more than corePoolSize threads as needed, similar to a cached thread pool?