From the course: Java Concurrency Troubleshooting: Latency and Throughput

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Java stream issues

Java stream issues - Java Tutorial

From the course: Java Concurrency Troubleshooting: Latency and Throughput

Start my 1-month free trial

Java stream issues

- [Instructor] Despite your best efforts, multithreading sometimes just doesn't work out as described. Now the JDK has been making it increasingly easy to write multithreaded applications with a lot of convenience classes and utilities for managing threads. With Streams in Java, it's now easier than ever to parallelize operations on data. A quick refresher on Java Streams. Java streams are an efficient mechanism for processing data. The data can be fed or streamed in from a data source like a collection, an operation, or even some IO resource. So in general, Java streams are immutable. They are lazily evaluated, and they support cheap parallelism. And you can write with them in a fluent API supported by lambda expressions. Now, let's start with one of my favorite bits of slightly misleading advertising: the parallelism in Java Streams. So here on line 60, I have my scramble with stream method that creates a stream using…

Contents