解释 Akka 线程池执行器配置参数

Explaining Akka Thread Pool Executor Config Parameters

据我了解,当创建 actor 系统时提供 non 时,fork-join-executor 是默认调度程序 有人可以向我解释以下内容吗:

fork-join-executor {
        # Min number of threads to cap factor-based parallelism number to
        parallelism-min = 8

        # The parallelism factor is used to determine thread pool size using the
        # following formula: ceil(available processors * factor). Resulting size
        # is then bounded by the parallelism-min and parallelism-max values.
        parallelism-factor = 3.0

        # Max number of threads to cap factor-based parallelism number to
        parallelism-max = 64

        # Setting to "FIFO" to use queue like peeking mode which "poll" or "LIFO" to use stack
        # like peeking mode which "pop".
        task-peeking-mode = "FIFO"
      }

虽然我理解每个词,但我不理解这里解释的全部语义。

谁能用英语给我解释一下上面的配置是什么意思。通过在这里和那里阅读许多 post,我有点理解默认情况下,akka 会设置一个 threadPoolexecutor,为每个核心分配和线程。因此,如果你有 2 个双核处理器,你最终会得到 4 个线程。无论如何,这就是您真正可以平行的程度。在此之上它是并发的,但严格来说不是完全并行的。虽然那是另一个问题。

因此,如果有人可以用 2 个机器示例(根据他们的处理器配置)从处理器和内核以及由此产生的线程数来解释上述配置,那就太好了。

这个问题是answered in depth on akka-user by Viktor Klang, in essence: we highly recommend reading up on the ForkJoinPool documentation in the JDK docs,它很深入地涵盖了这些问题。