diff options
author | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-12-09 10:08:11 +0000 |
---|---|---|
committer | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-12-09 10:08:11 +0000 |
commit | a730fb5cc6cea39a29e9ff4cd666fa8498f6adec (patch) | |
tree | a271e1b7cdd2bd044344fa7aef19d6820637b3a5 /test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala | |
parent | 4dbe72f83f7ade1517bad7444009d3d0c8a69bd5 (diff) | |
download | scala-a730fb5cc6cea39a29e9ff4cd666fa8498f6adec.tar.gz scala-a730fb5cc6cea39a29e9ff4cd666fa8498f6adec.tar.bz2 scala-a730fb5cc6cea39a29e9ff4cd666fa8498f6adec.zip |
Fixing jvm 1.5 support for parallel collections.
Special cased with thread pool executor scheduling. Fixed an ugly
concurrency bug where futures returned by a thread pool executor didn't
remove the task from the queue when cancel was called. Note to self and
others: don't cancel futures returned by thread pool executors, it might
lead to unexpected behaviour. Modified the executor to add new threads
if all the active threads are syncing, in order to avoid deadlocks.
Fixed a hidden bug in AdaptiveWorkStealingTasks, where correct behaviour
depended on the execution order of the tasks. This didn't fail before
with ForkJoinTasks, since there the execution order is well-defined.
Scalachecked 1.5 & 1.6 support.
No review.
Diffstat (limited to 'test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala')
-rw-r--r-- | test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala index 17ad2f9882..b5dcfca872 100644 --- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala +++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala @@ -7,7 +7,7 @@ object ForeachHeavy extends Companion { def benchName = "foreach-heavy"; def apply(sz: Int, parallelism: Int, what: String) = new ForeachHeavy(sz, parallelism, what) override def comparisons = List("jsr") - override def defaultSize = 16 + override def defaultSize = 2048 val fun = (a: Cont) => heavyOperation(a) val funjsr = new extra166y.Ops.Procedure[Cont] { @@ -21,7 +21,7 @@ object ForeachHeavy extends Companion { def checkPrime(n: Int) = { var isPrime = true var i = 2 - val until = scala.math.sqrt(n).toInt + 1 + val until = 550 while (i < until) { if (n % i == 0) isPrime = false i += 1 |