Chapter 9: Working with Concurrent Collections in .NET

This chapter will dive deeper into some of the concurrent collections in the System.Collections.Concurrent namespace. These specialized collections help to preserve data integrity when using concurrency and parallelism in your C# code. Each section of this chapter will provide practical examples of how to use a specific concurrent collection provided by .NET.

We have seen some basic use of parallel data structures in .NET. We have already covered the basics of each of the concurrent collections in the Introduction to concurrency section of Chapter 2. So, we will quickly jump into the examples of their use in this chapter and learn more about their application and inner workings.

In this ...

Get Parallel Programming and Concurrency with C# 10 and .NET 6 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.