May 30th, 2017

Java 9’s other new enhancements, Part 6: Concurrency

Java APIs, Java Concurrency, Java Language, Learn Java, others, Programing, by admin.

JEP 266: More Concurrency Updates defines an interoperable publish-subscribe framework for reactive streams, enhancements to the java.util.concurrent.CompletableFuture class, and various other improvements. This post wraps up my series on Java 9’s other new enhancements by acquainting you with these concurrency enhancements.

Publish-subscribe framework for reactive streams

Java 9 includes a publish-subscribe framework for reactive streams. In this section, I first introduce the concept of reactive streams and then present this publish-subscribe framework.

Introducing reactive streams

Data processing has evolved from batch architectures that collect data and subsequently process the data after some threshold has been reached, to stream-oriented architectures that help to turn data into knowledge as quickly as possible. Stream-oriented architectures capture and process live data, and modify systems based on the processed results very quickly (typically in seconds or less). In contrast, a batch-processing system might take hours, days, or weeks to respond.

Handling streams of data (especially “live” data whose volume isn’t predetermined) requires special care in an asynchronous system. The main issue is that resource consumption needs to be controlled so that a fast data source doesn’t overwhelm the stream destination. Asynchrony is needed to enable the parallel use of computing resources, on collaborating network hosts or multiple CPU cores within a single machine, which can greatly speed up data processing.

Back Top

Leave a Reply