3

Since 2.9 , we can create a parallel collection by a single method par. It is easy and simple, but how to control the concurrency for the parallel collection ?

爱国者
  • 4,298
  • 9
  • 47
  • 66

1 Answers1

5

On 2.9.1, the following approach worked for me:

collection.parallel.ForkJoinTasks
  .defaultForkJoinPool.setParallelism(<number of needed threads>)

See this question.

Community
  • 1
  • 1
Rogach
  • 26,050
  • 21
  • 93
  • 172