English
Topic 6. Data parallelism: parallel loops, PLINQ, data partitioning; parallel sorting and reduction algorithms
Goal: become familiar with data parallelism on .NET; learn to parallelize loops with Parallel.For and Parallel.ForEach using thread-local state, choose a data partitioning strategy, and write PLINQ queries with aggregation; master parallel reduction, prefix sum, and sorting algorithms, speedup and efficiency measurement, and result verification against a sequential version.
Lecture contents
- Parallel loops with the Parallel class — Data parallelism and task parallelism · Parallel.For and Parallel.ForEach loops
- Parallel.Invoke and data partitioning — Parallel.Invoke, Parallel.ForAsync, and Parallel.ForEachAsync · Data partitioning
- PLINQ and aggregation — PLINQ: parallel queries · Aggregation: associativity and commutativity
- Reduction, sorting, and performance — Parallel reduction and prefix sum · Parallel sorting algorithms · Other data parallelism patterns · Performance analysis
- Examples and common mistakes — Program examples · Common mistakes