Making applications concurrent can be a vital part of ensuring good responsiveness and high performance, but standard collections are not designed for concurrent environments.
In this course, C# Concurrent Collections, you’ll learn how to use concurrent collections to bring the power of manipulating data in collections to multithreaded scenarios by thinking about problems in a concurrent way.
First, you’ll discover how to avoid race conditions and data corruption, and how to use lambdas and closures to complete concurrent collection operations in a thread-safe way. Next, you’ll explore producer-consumer collections, such as stacks and queues. Then, you'll learn how to safely consume all items from a queue when you don’t know if other threads might be adding other items. Finally, you’ll delve into good coding practices to keep your concurrent collection code efficient.
By the end of this course, you’ll understand how to safely store data in collections and have multiple threads access that data concurrently, while avoiding the thread synchronization bugs that can otherwise plague concurrent code.
Simon is a senior developer with over 20 years programming experience, particularly covering C++ and the .NET Framework. He believes knowledge is to be shared and has written or co-written more than a dozen books for professional programmers.
Course Overview Hi, everyone. I'm Simon Robinson, and welcome to C# Concurrent Collections. And let me tell you, collections are amazing, and having apps work asynchronously is amazing, and when you put the two together, you have the power to truly manipulate data in a way that makes full use of the CPU to give you a highly responsive, efficient, multitasking app. That's what concurrent collections can offer you. But if you don't understand how to use concurrence collections properly, it's surprisingly easy to corrupt your data through thread‑synchronization bugs. Merely being able to launch async tasks isn't enough if you have data shared between different threads. You also have to learn to think about your logic in a concurrent way, so you can anticipate and avoid threads corrupting each other's data. And that's exactly what I teach in this course. You'll learn all about how to read and updates data in a concurrence dictionary in a thread‑safe way, and along the way, you'll learn how atomic methods can help keep your data safe and how race conditions can destroy that safety if you're not careful. Then I'll show you how to use producer‑consumer collections, stacks, and queues, and bags to safely generate items to be processed, and then have other threads process those items, just like complex enterprise apps, such as web servers and database servers have to do all the time. By the end of this course, you'll be able to use concurrence collections to create efficient code that safely allows multiple threads to simultaneously access and manipulate data in collections.