summaryrefslogtreecommitdiff
path: root/src/forkjoin/scala/concurrent/forkjoin/ForkJoinWorkerThread.java
Commit message (Collapse)AuthorAgeFilesLines
* Remove our fork of forkjoin. Java 8 bundles it.Adriaan Moors2015-07-151-122/+0
| | | | | | | | | | | | | | | | | | | | | Provide deprecated compatibility stubs for the types and static members, which forward as follows: ``` scala.concurrent.forkjoin.ForkJoinPool => java.util.concurrent.ForkJoinPool scala.concurrent.forkjoin.ForkJoinTask => java.util.concurrent.ForkJoinTask scala.concurrent.forkjoin.ForkJoinWorkerThread => java.util.concurrent.ForkJoinWorkerThread scala.concurrent.forkjoin.LinkedTransferQueue => java.util.concurrent.LinkedTransferQueue scala.concurrent.forkjoin.RecursiveAction => java.util.concurrent.RecursiveAction scala.concurrent.forkjoin.RecursiveTask => java.util.concurrent.RecursiveTask scala.concurrent.forkjoin.ThreadLocalRandom => java.util.concurrent.ThreadLocalRandom ``` To prepare for Java 9, the Scala library does not itself use `sun.misc.Unsafe`. However, for now, it provide a convenience accessor for it via `scala.concurrent.util.Unsafe`. This (deprecated) class will be removed as soon as the eco-system drops its use (akka-actor, I'm looking at you).
* Add missing canonical combinators:Viktor Klang2014-10-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `def transform[S](f: Try[T] => Try[S])(implicit executor: ExecutionContext): Future[S]` - `def transformWith[S](f: Try[T] => Future[S])(implicit executor: ExecutionContext): Future[S]` - `def flatten[S](implicit ev: T <:< Future[S]): Future[S]` - `def zipWith[U, R](that: Future[U])(f: (T, U) => R)(implicit executor: ExecutionContext): Future[R]` Add missing utilities: - `val unit: Future[Unit]` in `object Future` - `object never extends Future[Nothing]` in `object Future` - `def defaultBlockContext: BlockContext` in `object BlockContext` - `def toString: String` on stdlib implementations of `Future` Refactors: - the `scala.concurrent.Future` trait to not explicit create any `Promises`, so that implementations can control implementation type, this is mainly facilitated through adding of the `transform` and `transformWith` methods. - the implementation of `ExecutionContextImpl` has been cleaned up - the `scala.concurrent.impl.DefaultPromise` has been reimplemented to not use `sun.misc.Unsafe` Securing: - Add a self-check in `completeWith` and `tryCompleteWith` to avoid cycles in trait Promise - Capping the maximum number of threads for the global `ExecutionContext` to the max parallelism - Implementing (almost) all `Future` combinators on `transformWith` and `transform` means that `DefaultPromise` linking works on both `(flat)map` and `recover(With)` - Nested `blocking {}` should not spawn extra threads beyond the first. Removes: - the private `internalExecutor` method in favor of an import in trait `Future` - the private `internalExecutor` method in favor of an import in trait `Promise` - the `AtomicReferenceFieldUpdater` in `AbstractPromise` since we're using `Unsafe` - `scala.concurrent.impl.Future` is no longer needed Deprecates: - `Future.onSuccess` - discourage the use of callbacks (and is also redundant considering `foreach` and `onComplete`) - `Future.onFailure` - discourage the use of callbacks (and is also redundant considering `onComplete` and `failed.foreach`) - `ExecutionContext.prepare` - it was ill specced and it is too easy to forget to call it (or even know when to call it or call it more times than needed) - All classes in scala.concurrent.forkjoin. Scala 2.12 will be Java 8+ and as such the jsr166e should be used as included in java.util.concurrent. Reimplements: - `failed` - in terms of `transform` - `map` - in terms of `transform` - `flatMap` - in terms of `transformWith` - `recover` - in terms of `transform` - `recoverWith` - in terms of `transformWith` - `zip` - in terms of `flatMap` + `map` - `fallbackTo` - in terms of `recoverWith` + `recoverWith` - `andThen` - in terms of `transform` Miscellaneous: - Giving the threads of `ExecutionContext.global` sensible names - Optimizes `object Future.successful` and `object Future.failed` are now separate implementations, to optimize for the result, avoiding doing work for the "other branch". - Optimizes `compressedRoot()` by avoiding double-calls to volatile get. Documentation: - Almost all methods on `Future` and `Promise` have been revisited and had their ScalaDoc updated Tests: - Yes
* SI-7442 Update bundled Fork/Join pool (JSR166y)Philipp Haller2013-05-111-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Updates ForkJoinPool and dependent classes to the latest jsr166y revisions: ForkJoinPool.java: Revision 1.185 Sat Feb 16 20:50:29 2013 UTC (2 months, 2 weeks ago) by jsr166 ForkJoinTask.java: Revision 1.100 Tue Feb 5 17:09:54 2013 UTC (3 months ago) by jsr166 ForkJoinWorkerThread.java: Revision 1.73 Wed Nov 21 19:54:39 2012 UTC (5 months, 2 weeks ago) by dl - Includes Akka-contributed `sun.misc.Unsafe` detection to support Android. See changeset 06d685c1bbd8a0d058ee8a3f374569f8097f2acc - Adds private `CountedCompleter` class. This class is only visible and used in `ForkJoinPool.java`. - Updates desired.sha1 for updated forkjoin.jar. - Updates binary compatibility whitelists to exclude package-private methods in the `forkjoin` package. - Also fixes SI-7438.
* Added updated ForkJoinPool, w/ necessary updates to Scala Actors.Heather Miller2012-02-251-705/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes Doug Lea's updates to ForkJoinPool, as of January 25th, 2012. Details of the changes and performance improvements available at: http://markmail.org/message/323vxzn6irkk5yrg. The ForkJoinPool used in this commit comes from the most recent JSR166y. Additionally, also included are minimal changes to parts of the Scala Actors library which interface with the ForkJoinPool, as the ForkJoinPool's interface has changed (prior to the release of Java 7) since we last updated it for the Scala 2.8 release. Of note- this is part of the planned overhaul of scala.concurrent, and corresponds to ticket SI-5523. For testing this was built on JDK 1.6, and passes all tests on both JDK 1.5 and 1.6. A new forkjoin.jar is necessary prior to applying these changes. Using this source, the new jar can be built by running: ant newforkjoin forkjoin.done This creates a new forkjoin.jar in build/libs/. It must replace lib/forkjoin.jar.
* Reverted r25440 (update of forkjoin library) un...Philipp Haller2011-08-151-718/+522
| | | | | | Reverted r25440 (update of forkjoin library) until all build problems are resolved. No review.
* Update fork/join framework to JDK release 1.7.0Philipp Haller2011-08-031-522/+718
|
* moved forkjoin sources out of the library folderLukas Rytz2009-12-021-0/+773