RFR 8003981: Support Parallel Array Sorting (original) (raw)

Chris Hegarty chris.hegarty at oracle.com
Fri Dec 21 10:31:22 UTC 2012


On 12/21/2012 01:49 AM, David Holmes wrote:

Hi Chris,

The specdiff is missing the Object variants for some reason.

Sorry, I should have noticed this. There was an old version of specdiff in my environment. I regenerated the specdiff ( it's all there ), and updated the original specdiff link.

Otherwise this looks pretty much as I remember it. :)

Good to hear that!

There is an open question as to whether MINARRAYSORTGRAN should be configurable/overridable.

My opinion, for what it's worth, is to keep this out of the API. It seems like very advanced use, and not for the masses. It may just confuse the average developer, thinking that they need to thinker with it in some way. It is also worth noting ( if I read the code correctly ), that the threshold is not configurable in Doug's ParallelArray either. Has there been calls for it to be? (I'm not sure)

If needs be, then maybe a system property could be defined to initialize the threshold value, but I would like to hear justification for such a property.

-Chris.

Thanks, David On 21/12/2012 3:31 AM, Chris Hegarty wrote: This is a review request for the addition of utility methods to java.util.Arrays that provide sorting of arrays in parallel, JEP 103 [1].

Webrev: http://cr.openjdk.java.net/~chegar/8003981/ver.00/ Current sorting implementations provided by the Java Collections Framework (Collections.sort and Arrays.sort) all perform the sorting operation sequentially in the calling thread. This enhancement will offer the same set of sorting operations currently provided by the Arrays class, but with a parallel implementation that utilizes the Fork/Join framework. These new API’s are still synchronous with regard to the calling thread as it will not proceed past the sorting operation until the parallel sort is complete. The actual sorting API this proposal adds will leverage the ForkJoinPool.commonPool (default Fork/Join pool defined as part of JEP 155). The sorting algorithm is that used in Doug Lea’s ParallelArray implementation. This work was originally done over in the lambda/lambda repo by David Holmes, and is now being cleaned up and brought into jdk8. Open issues/differences from version in lambda: 1) Is is necessary for MINARRAYSORTGRAN to be in the public API? It is an implementation detail (easy to remove). 2) The use of FJP.commonPool is an implementation detail, not part of the spec. Should not be a problem, just worth pointing out, as it differs from what is in lambda/lambda. -Chris. [1] http://openjdk.java.net/jeps/103



More information about the core-libs-dev mailing list