Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Concurrency 邮箱是ForkJoinTask,但ExecutorService可以是ThreadPoolExecutor:这样可以吗?_Concurrency_Akka - Fatal编程技术网

Concurrency 邮箱是ForkJoinTask,但ExecutorService可以是ThreadPoolExecutor:这样可以吗?

Concurrency 邮箱是ForkJoinTask,但ExecutorService可以是ThreadPoolExecutor:这样可以吗?,concurrency,akka,Concurrency,Akka,在Akka 2.6.10中,邮箱是一个ForkJoinTask以及一个Runnable private[akka]抽象类邮箱(val-messageQueue:messageQueue) 任务[单位] 使用SystemMessageQueue 带Runnable{ //可运行方法 覆盖最终def运行():单位={ // ... processMailbox() dispatcher.registerForExecution(this,false,false) // ... } //ForkJoi

在Akka 2.6.10中,邮箱是一个
ForkJoinTask
以及一个
Runnable

private[akka]抽象类邮箱(val-messageQueue:messageQueue)
任务[单位]
使用SystemMessageQueue
带Runnable{
//可运行方法
覆盖最终def运行():单位={
// ...
processMailbox()
dispatcher.registerForExecution(this,false,false)
// ...
}
//ForkJoinTask方法
最终覆盖def exec():布尔={
// ...
运行()
// ...
}
}
但executor服务可以配置为使用ADPool executor(TP),而不是使用ForkJoinPool(FJ)。因此,TP有可能执行
ForkJoinTask

这可能完全合理,但TP执行FJ任务的事实在我看来有点奇怪。有人能在这里分享决策推理吗?
ForkJoinTask
如何使Akka受益,即使它可以由
theadapoolexecutor
执行