Why ForkJoinPool was forked for Scala?
Which implementation and for which case is preferred?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The obvious reason for the scala library to have its own copy of ForkJoinPool is that scala must run on pre-1.7 JVMs, and
ForkJoinPoolwas only introduced in Java 1.7.In addition, there were a few changes made for internal (scala) use, such as this:
https://github.com/scala/scala/commit/76e9da2ca4c31daec2b04848c3c2dbad6ecd426e
Given that scala’s version will probably not give you any advantage (if you are compiling and running against java 1.7), I’d say that for you own use you should probably use java’s version. At least java’s version is precisely documented and fully “public”, while the status of scala’s version is unclear (it might very well be intended for internal use only). However in some places you might not have any choice. By example
ForkJoinTaskshas aforkJoinPoolmethod that expects scala’s version ofForkJoinPool. If someone can get/find any official status for scala’s version ofForkJoinPoolstating that it’s really public and stable, then I’ll happily revert this advice.