What is `ForkJoinPool.commonPool()` and when should it be avoided?

Java Professional Hard

Java Professional — Hard

What is `ForkJoinPool.commonPool()` and when should it be avoided?

Key points

  • `ForkJoinPool.commonPool()` is shared among parallel streams and async tasks.
  • Blocking tasks on this pool can delay other parallel operations.
  • Avoid using it for tasks that may block for a long time.

Ready to go further?

Related questions