Parallelism: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=External=
=Internal=
=Internal=



Revision as of 02:17, 29 March 2018

External

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, provided that the functions that are used in mapping and reductions are associative, stateless and non-interfering. Map-reduce is an alternative to iterative operations, which involves sharing state and does not parallelize gracefully.