问题描述
我一直在寻找新的Scala 2.9并行集合,并希望放弃大量我那些类似的东西的简陋业余版本.特别是,我想用我自己的东西(例如,通过参与者在网络上分配任务评估的东西)替换默认实现基础下的派生联接池.我的理解是,这仅是应用Scala的可堆叠修改"范式的问题,但是collections库令人生畏,以至于我不确定要修改哪些位!
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!
一些具体问题:
- 通过
ForkJoinTasks
? - 我看到还有一个替代特征,
FutureThreadPoolTasks
.我将如何构建使用此特征而不是ForkJoinTasks
? - 我能再写一个替代方法(也许是一个相应的样板类,混在
AdaptiveWorkStealingTasks
并以某种方式实例化使用此新特征的集合实例?
(作为参考,上述所有特征均在 Tasks.scala .)
(For reference, all of the traits mentioned above are defined in Tasks.scala.)
特别欢迎使用代码示例!
Especially code examples are very welcome!
推荐答案
此处是描述如何在Scala 2.10中切换TaskSupport
对象的文档.
Here is a document describing how to switch TaskSupport
objects in Scala 2.10.
这篇关于如何替换Scala 2.9并行集合的派生联接池?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!