-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Remove our fork of forkjoin. Java 8 bundles it. #4629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
be0c544
to
8367c59
Compare
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).
Review by @SethTisue |
This patch will make the Oracle guys working on Project Jigsaw very happy, as it removes the Unsafe dependency 👍 |
Thanks @ktoso for akka/akka#18009 |
@adriaanm I've removed further detritus here: adriaanm/scala@adriaanm:unforkjoin...retronym:review/unforkjoin |
Use j.u.c.Forkjoin directly in active and disabled tests Remove bitrotted benchmarks code I was going to update these to use `java.util.concurrent.ForkJoin` directly, instead of our deprecated stubs. But most of them don't compile anymore (e.g. scala.testing.Benchmark has been removed, ClassTag imports missing). While I'm all for benchmarks, we should have large swathes of code checked in that isn't at compiled and run automatically. I'm happy to help someone resurrect these in a suitable form.
Thanks! Looks like I missed quite a few spots :-) Squashed them onto my first round of sweeping. |
Not sure quite how to manage the updates for these, but I've grepped for Maybe we can find some additional defacto API that needs to be stubbed in these, too. |
LGTM, I've added the "release-notes" label. |
LGTM |
Remove our fork of forkjoin. Java 8 bundles it.
|
||
// TODO: remove once akka no longer needs it, hopefully by 2.12.0-M3! | ||
@Deprecated | ||
public final class Unsafe { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of other places where we'll need to get rid of Unsafe
, most notably, Future
s and TrieMap
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Futures don't use Unsafe anymore AFAIK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One left to fix then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction - the TrieMap
uses AtomicReferenceFieldUpdater
s - we never changed it to Unsafe
. So, we're good there too.
I'm a little bit surprised that we decided to remove the old (currently unused) benchmark code as part of this PR (which is about dropping our bundled Fork/Join pools) - I thought that PRs are supposed to be on-topic. But that's ok with me. For what it's worth, I would be interested in reviving some of these benchmarks, and making sure that they run on a nightly basis, along with producing some fancy reports. These need not impact the correctness of the build, but would be useful as a sanity check - we often ask our submitters to do some benchmarks. We certainly have the infrastructure to do that systematically now. |
Provide deprecated compatibility stubs for the types and static members,
which forward as follows:
To prepare for Java 9, the Scala library avoids using
sun.misc.Unsafe
.However, for now, it does 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 -- cc @viktorklang).