July 21, 2013 Java 8 added parallel sorting capabilities to java.util.Arrays to take advantage of multicore/multithread machines ( JEP 103 ). My Macbook Air has an i7 processor which has 2 cores, but 4 threads of execution. java.util.concurrent.ForkJoinPool.getCommonPoolParallelism() == 4; // true Calling Arrays.parallelSort() is a no-op if your machine returns 1 thread of execution for the method above, because that method will fallback to the normal sequential sort that exists in Java 7 and earlier. Assuming that your machine is in fact multicore,
Read full article from Java 8 – Parallel Array Sorting | after work
No comments:
Post a Comment