Parallelism: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 6: Line 6:


Parallelism can be exploited when the code that is executed in parallel is safe, meaning the code does not access shared data. This code is referred to as <span id='Pure_Function'></span>[[Functional_Programming#Pure_Function|pure function]].
Parallelism can be exploited when the code that is executed in parallel is safe, meaning the code does not access shared data. This code is referred to as <span id='Pure_Function'></span>[[Functional_Programming#Pure_Function|pure function]].
=Streams API and Parallelism=
The Streams API exposes [[Transforming Data with Java 8 Streams API#Overview|map]] and reduce operations, which then can be internally parallelized over the elements of the stream.

Revision as of 02:12, 29 March 2018

Internal

Overview

Parallelism can be exploited when the code that is executed in parallel is safe, meaning the code does not access shared data. This code is referred to as pure function.

Streams API and Parallelism

The Streams API exposes map and reduce operations, which then can be internally parallelized over the elements of the stream.