Java 8 Parallel Streams Internals (Part 1) - Vanderbilt University
Java 8 Parallel Streams Internals
(Part 1)
Douglas C. Schmidt
d.schmidt@vanderbilt.edu dre.vanderbilt.edu/~schmidt
Professor of Computer Science Institute for Software Integrated Systems Vanderbilt University
Nashville, Tennessee, USA
Learning Objectives in this Part of the Lesson
? Understand parallel stream internals
List
List1
trySplit()
List2
trySplit()
trySplit()
List1.1
List1.2 List2.1
List2.2
Process sequentially
Process sequentially
Process sequentially
Process sequentially
join
join
join
See developerworks2/library/j-java-streams-3-brian-goetz
Learning Objectives in this Part of the Lesson
? Understand parallel stream internals, e.g. ? Know what can change & what can't
See en.3/wiki/Serenity_Prayer
Why Knowledge of Parallel Streams Matters
4
Why Knowledge of Parallel Streams Matters
? Converting a Java 8 sequential stream to a parallel stream is usually quite straightforward
Changing stream() calls to parallelStream() calls
involves minuscule effort!!
List processStream() {
return getInput() .stream() .map(this::processInput) .collect(toList());
}
vs
List processStream() {
return getInput() .parallelStream() .map(this::processInput) .collect(toList());
}
See "Java 8 SearchWith5ParallelStreams Example"
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- java 8 stream map function example
- java stream
- java 8 stream map exception handling
- java 8 stream map vs flatmap example
- java 8 stream map vs flatmap
- java 8 stream factory methods vanderbilt university
- java 8 stream map collect example
- java 8 stream map catch exception
- java 8 stream map error handling
- java 8 stream map string to object