I've been looking at the new Scala 2.9 parallel collections and am hoping to abandon a whole lot of my crufty amateur versions of similar things. In particular, I'd like to replace the fork join pool which underlies the default implementation with something of my own (for example, something that distributes evaluation of tasks across a network, via actors). My understanding is that this is simply a matter of applying Scala's paradigm of "stackable modifications", but the collections library is intimidating enough that I'm not exactly sure which bits need modifying!
Some concrete questions:
ForkJoinTasks
?FutureThreadPoolTasks
. How would I build a collection which uses this trait instead of ForkJoinTasks
?AdaptiveWorkStealingTasks
and somehow instantiate collections instances that use this new trait?(For reference, all of the traits mentioned above are defined in Tasks.scala.)
Especially code examples are very welcome!
Here is a document describing how to switch TaskSupport
objects in Scala 2.10.