不传递Executorto CompletableFuture.runAsync(),ForkJoinPool则使用公共。相反,对于我想要异步执行的简单任务(例如,我不需要链接不同的任务),我可能只使用ForkJoinPool.commonPool().execute().
为什么应该优先考虑另一个?例如,是否runAsync()有任何实质性的开销execute()?前者比后者有什么特别的优势吗?
java multithreading asynchronous forkjoinpool completable-future