© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
V. SarcarParallel Programming with C# and .NEThttps://doi.org/10.1007/979-8-8688-0488-5_4

4. Working on Parallel Loops

Vaskaran Sarcar1  
(1)
Near Garia Station, Post: Garia, Kuntala Furniture, 2nd Floor, Kolkata, West Bengal, India
 

C# developers are quite familiar with using foreach and for loops. By using these iteration statements, we can repeatedly execute a statement or a block of statements. This chapter primarily focuses on their parallel versions. It also helps you experiment with similar constructs that support parallel programming.

Revisiting Sequential Loops

Before we discuss parallel loops, let’s analyze a common scenario where you would usually use ...

Get Parallel Programming with C# and .NET: Fundamentals of Concurrency and Asynchrony Behind Fast-Paced Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.