diff options
author | Aleksandar Prokopec <axel22@gmail.com> | 2013-10-28 11:20:23 +0100 |
---|---|---|
committer | Aleksandar Prokopec <axel22@gmail.com> | 2013-10-29 12:15:10 +0100 |
commit | 344ac60c3f34cc0a1c6e6aae1479878fe63476eb (patch) | |
tree | 97e5de64b81b5cb76913e8773171a1ad93b43244 /test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala | |
parent | 1819af77fd4ecc66c89a84ea321aa7d6f92285ec (diff) | |
download | scala-344ac60c3f34cc0a1c6e6aae1479878fe63476eb.tar.gz scala-344ac60c3f34cc0a1c6e6aae1479878fe63476eb.tar.bz2 scala-344ac60c3f34cc0a1c6e6aae1479878fe63476eb.zip |
SI-7938 - parallel collections should use default ExecutionContext
Parallel collections now use `scala.concurrent.ExecutionContext`
by default.
The `ExecutionContextTaskSupport` is optimized to use the
`ForkJoinPool` underlying the `ExecutionContext` if possible.
Otherwise, a fallback `TaskSupport` that creates a reduction tree and
execute an operation through `Future`s is used.
Diffstat (limited to 'test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala')
-rw-r--r-- | test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala b/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala index b952704af2..cf15afb3b9 100644 --- a/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala +++ b/test/files/scalacheck/parallel-collections/ParallelCtrieCheck.scala @@ -25,6 +25,8 @@ abstract class ParallelConcurrentTrieMapCheck[K, V](tp: String) extends Parallel def hasStrictOrder = false + def tasksupport: TaskSupport + def ofSize(vals: Seq[Gen[(K, V)]], sz: Int) = { val ct = new concurrent.TrieMap[K, V] val gen = vals(rnd.nextInt(vals.size)) @@ -34,6 +36,7 @@ abstract class ParallelConcurrentTrieMapCheck[K, V](tp: String) extends Parallel def fromTraversable(t: Traversable[(K, V)]) = { val pct = new ParTrieMap[K, V] + pct.tasksupport = tasksupport var i = 0 for (kv <- t.toList) { pct += kv @@ -45,7 +48,7 @@ abstract class ParallelConcurrentTrieMapCheck[K, V](tp: String) extends Parallel } -object IntIntParallelConcurrentTrieMapCheck extends ParallelConcurrentTrieMapCheck[Int, Int]("Int, Int") +class IntIntParallelConcurrentTrieMapCheck(val tasksupport: TaskSupport) extends ParallelConcurrentTrieMapCheck[Int, Int]("Int, Int") with PairOperators[Int, Int] with PairValues[Int, Int] { |