2

By default ParallelStreams run in a common ForkJoinPool, but you can also run it in a specific ForkJoinPool with specified level of parallelism. It seems, though, that ForkJoinPool does not have newCachedThreadPool() in ForkJoinPool as you do in ExecutorService, and you cannot run parallel streams in a specific ExecutorService.

So, my question is:

Is there a way to run parallel streams in an unbounded, cached pool size, in a manner similar to how ExecutorService constructed with newCachedThreadPool() operates?

Tofig Hasanov
  • 3,303
  • 10
  • 51
  • 81

0 Answers0