Why does Scala use a ForkJoinPool to back its default ExecutionContext?
I can't speak for the scala designers, but idiomatic use of scala Future
s often involves creation of a lot of very small, short-lived tasks (e.g. every map
call creates a new task) and so the work-stealing design is appropriate.
If you care about these kind of precise details you might prefer to use scalaz-concurrent's Future
, which uses trampolines to avoid creating extra tasks for each map
step and makes execution contexts explicit (and AIUI defaults to a ThreadPoolExecutor
).