Click " programmer Big Coffee " above, select "Public number"
Critical moment, first time delivery.
Some changes have been made to the concurrent packages in Java 8 and Java 9, and the changes are summarized in this article.
changes in Concurrent package in Java 8
new classes and interfaces in Java.util.concurrent
Two new interfaces and 4 new classes were added:
Interface Completablefuture.asynchronouscompletiontask
Interface Completionstage
Class Completablefuture
Class Concurrenthashmap.keysetview
Class Countedcompleter
Class Completionexception
a new method of Java.util.concurrent.ConcurrentHashMap
The collection framework has been revised in Java 8 to add a number of aggregation methods based on stream and lambda expressions. So Concurrenthashmap also introduced 30 new methods, including a variety of foreach methods (foreach, Foreachkey, Foreachvalue, and Foreachentry), search methods (searching, sea Rchkeys, Searchvalues, and searchentries) and reduction methods (reduce, reducetodouble, Reducetolong, etc.).
Some other methods have been added, such as Mappingcount and Newkeyset. and the current version of the Concurrenthashmap is more suitable for cache, because it increases the check method when the key value does not exist.
new classes in the Java.util.concurrent.atomic
In order to compute count and sum concurrently, new Doubleaccumulator, Doubleadder, Longaccumulator, Longadder classes are introduced, providing a higher throughput rate than atomic.
a new method of Java.util.concurrent.ForkJoinPool
Static Commonpool () is added to provide a universal pool for forkjointask.
Two methods Getcommonpoolparallelism () and Commonpool () provide different configurations.
New Class Java.util.concurrent.locks.StampedLock
The new class Stampedlock provides three modes (write, read, and optimistic) to improve performance.
changes in Concurrent package in Java 9
The main is Jep 266:more concurrency Updates, including publish-subscribe, completablefuture interface strengthening and so on.
Support for reactive STREAMS Publish-subscribe Framework, four interfaces Processor, Publisher, subscriber, Subscription, container class Java.util.concurrent.f Low, Java.util.concurrent.SubmissionPublisher
Completablefuture class strengthens, supports delays, timeout, subclassing, and other methods
Tuning and modifying Javadoc
reference Documentation
Concurrency Utilities Enhancements in Java SE 8
Https://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/changes8.html
Java 9′s Other new enhancements, part 6:concurrency
Https://www.javaworld.com/article/3198904/learn-java/java-9s-other-new-enhancements-part-6-concurrency.html
The Essential Java 9 Feature you Probably Never Heard of
https://blog.takipi.com/the-essential-java-9-feature-you-probably-never-heard-of/
Java 9′s Other New enhancements
Https://www.infoworld.com/article/3169289/java/java-9s-other-new-enhancements-part-2.html
Jep 266:more concurrency Updates
http://openjdk.java.net/jeps/266
Java 9 Series:concurrency Updates
https://www.voxxed.com/2016/10/java-9-series-concurrency-updates/
Some changes have been made to the concurrent packages in Java 8 and Java 9, and the changes are summarized in this article.
Source: Bird's Nest
colobu.com/2018/03/12/concurrency-utilities-enhancements-in-java-8-java-9/
Programmers to organize the release, reprint please contact the author to obtain authorization
"Click to become the Great God of Android"