根据关于并行收集和在互联网上搜索的论文,并行集合应该与视图一起工作,但我不清楚它们之间的区别
coll.par.view.someChainedIterations
和
coll.view.par.someChainedIterations
似乎coll.view.par失去了集合的视图:
scala> val coll = 1 to 3 coll: scala.collection.immutable.Range.Inclusive = Range(1,2,3) scala> coll.view.par res2: scala.collection.parallel.ParSeq[Int] = Pararray(1,3) scala> coll.par.view res3: java.lang.Object with scala.collection.parallel.ParSeqView[Int,scala.collection.parallel.immutable.ParSeq[Int],scala.collection.immutable.Seq[Int]] = $anon$1(1,3)