Java8 Parallel Streams
1 Parallelization
- Java SE fork/join Framework
- DIY parallel operations: thread-safety issues (thread interference
or memory consistency errors)
- Locks and Synchronization introduce thread contention.
- Java 8 parallel streams provide reliable parallelization into sub-tasks.
- Uses multi-core processors
2 Parallel Streams
- Discuss the example in the Oracle.com Parallelism link below.
3 Total Amount of Computing Time
- Parallelization cuts down on "elapsed" time.
- Suppose some computation C takes T units of time.
- Perfectly parallelized C with N cores should take T/N.
- Total (added across all cores) = T/N * N + overhead
4 Reference
- Oracle.com, Parallelism, 2015. Required Reading.