Custom thread pool in Java 8 parallel stream

后端 未结 15 917
旧巷少年郎
旧巷少年郎 2020-11-22 00:15

Is it possible to specify a custom thread pool for Java 8 parallel stream? I can not find it anywhere.

Imagine that I have a server application and I would like to

15条回答
  •  别跟我提以往
    2020-11-22 00:55

    We can change the default parallelism using the following property:

    -Djava.util.concurrent.ForkJoinPool.common.parallelism=16
    

    which can set up to use more parallelism.

提交回复
热议问题