Slides Concurrency The FixedThreadPool ExecutorService
Slides Concurrency The FixedThreadPool ExecutorService
Creating threads, destroying threads, and then creating them again can be
expensive.
A thread pool mitigates the cost, by keeping a set of threads around, in a pool, for
current and future work.
Threads, once they complete one task, can then be reassigned to another task,
without the expense of destroying that thread and creating a new one.
CachedThreadPool Creates new threads as needed, so its a variable size pool newCachedThreadPool