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
  • 2,337
  • 8
  • 46
  • 74

0 Answers0