From 67ed8c8b126915ea04417b465a950d0d7bbcc257 Mon Sep 17 00:00:00 2001 From: Simon Ochsenreither Date: Wed, 13 Mar 2013 16:28:32 +0100 Subject: SI-7236 Deprecate ThreadPoolTaskSupport and friends --- .../scala/collection/parallel/TaskSupport.scala | 24 ++++++++++------------ src/library/scala/collection/parallel/Tasks.scala | 4 +++- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/library') diff --git a/src/library/scala/collection/parallel/TaskSupport.scala b/src/library/scala/collection/parallel/TaskSupport.scala index 9bed5be51b..1ab41bd296 100644 --- a/src/library/scala/collection/parallel/TaskSupport.scala +++ b/src/library/scala/collection/parallel/TaskSupport.scala @@ -17,28 +17,25 @@ import scala.concurrent.ExecutionContext -/** A trait implementing the scheduling of - * a parallel collection operation. +/** A trait implementing the scheduling of a parallel collection operation. * * Parallel collections are modular in the way operations are scheduled. Each * parallel collection is parametrized with a task support object which is * responsible for scheduling and load-balancing tasks to processors. - * + * * A task support object can be changed in a parallel collection after it has * been created, but only during a quiescent period, i.e. while there are no * concurrent invocations to parallel collection methods. * * There are currently a few task support implementations available for * parallel collections. The [[scala.collection.parallel.ForkJoinTaskSupport]] - * uses a fork-join pool - * internally and is used by default on JVM 1.6 or greater. The less efficient - * [[scala.collection.parallel.ThreadPoolTaskSupport]] is a fallback for JVM - * 1.5 and JVMs that do not support the fork join pools. The - * [[scala.collection.parallel.ExecutionContextTaskSupport]] uses the + * uses a fork-join pool internally. + * + * The [[scala.collection.parallel.ExecutionContextTaskSupport]] uses the * default execution context implementation found in scala.concurrent, and it - * reuses the thread pool used in scala.concurrent (this is either a fork join - * pool or a thread pool executor, depending on the JVM version). The - * execution context task support is set to each parallel collection by + * reuses the thread pool used in scala.concurrent. + * + * The execution context task support is set to each parallel collection by * default, so parallel collections reuse the same fork-join pool as the * future API. * @@ -68,17 +65,18 @@ extends TaskSupport with AdaptiveWorkStealingForkJoinTasks * * @see [[scala.collection.parallel.TaskSupport]] for more information. */ +@deprecated("Use `ForkJoinTaskSupport` instead.", "2.11.0") class ThreadPoolTaskSupport(val environment: ThreadPoolExecutor = ThreadPoolTasks.defaultThreadPool) extends TaskSupport with AdaptiveWorkStealingThreadPoolTasks /** A task support that uses an execution context to schedule tasks. - * + * * It can be used with the default execution context implementation in the * `scala.concurrent` package. It internally forwards the call to either a * forkjoin based task support or a thread pool executor one, depending on * what the execution context uses. - * + * * By default, parallel collections are parametrized with this task support * object, so parallel collections share the same execution context backend * as the rest of the `scala.concurrent` package. diff --git a/src/library/scala/collection/parallel/Tasks.scala b/src/library/scala/collection/parallel/Tasks.scala index 441c4269c3..487b3d46d3 100644 --- a/src/library/scala/collection/parallel/Tasks.scala +++ b/src/library/scala/collection/parallel/Tasks.scala @@ -214,6 +214,7 @@ trait AdaptiveWorkStealingTasks extends Tasks { /** An implementation of tasks objects based on the Java thread pooling API. */ +@deprecated("Use `ForkJoinTasks` instead.", "2.11.0") trait ThreadPoolTasks extends Tasks { import java.util.concurrent._ @@ -322,6 +323,7 @@ trait ThreadPoolTasks extends Tasks { } +@deprecated("Use `ForkJoinTasks` instead.", "2.11.0") object ThreadPoolTasks { import java.util.concurrent._ @@ -455,7 +457,7 @@ trait AdaptiveWorkStealingForkJoinTasks extends ForkJoinTasks with AdaptiveWorkS } - +@deprecated("Use `AdaptiveWorkStealingForkJoinTasks` instead.", "2.11.0") trait AdaptiveWorkStealingThreadPoolTasks extends ThreadPoolTasks with AdaptiveWorkStealingTasks { class WrappedTask[R, Tp](val body: Task[R, Tp]) -- cgit v1.2.3