Skip to content
Advertisement

Tag: executorservice

Executors.newCachedThreadPool() versus Executors.newFixedThreadPool()

newCachedThreadPool() versus newFixedThreadPool() When should I use one or the other? Which strategy is better in terms of resource utilization? Answer I think the docs explain the difference and usage of these two functions pretty well: newFixedThreadPool Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue. At any point, at most nThreads

Advertisement