Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 438 Bytes

PH_S010.md

File metadata and controls

9 lines (5 loc) · 438 Bytes

PH_S010 - Parallel.For Side-Effects

Problem

The use of Parallel.For(...) with side-effects in its body is discouraged. Moreover, even the correct use of synchronization primitives is questionable as it neglects the parallelization gains.

Solution

Try to avoid side-effects in general. Make use of the localFinally argument for aggregation functions and concentrate the side-effects and necessary synchronization in there.