common pool
The JVM-wide shared thread pool that parallel streams and CompletableFuture use by default when you do not supply an executor.
In more detail
By default it has one thread fewer than the number of processor cores, which suits short computations. Blocking tasks on it starve every other user of the pool, so give blocking work its own executor.
Related terms
- thread pool — A fixed or bounded set of reusable worker threads that take tasks from a queue, instead of creating a new thread for each task.
- parallel stream — A stream that splits its work across several threads from the common pool, which can speed up large computations and slow down small ones.
- supplyAsync — The CompletableFuture method that starts a task producing a value on another thread and returns a future for it.
- CPU — The chip in a computer that runs program instructions; a machine can have several.
Taught in
- Async With CompletableFuture — Modern Java: Virtual Threads & High-Throughput Services
- Concurrent Collections And Parallel Streams — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep