From the course: Advanced C#: Thread-Safe Data with Concurrent Collections

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Categories of collections

Categories of collections

- [Instructor] To get a better idea of the purpose of the individual concurrent collections, it helps to group them into categories. In this diagram, I've organized the types into three columns which loosely organize them into logical categories. Think of the first column with the dictionary as the general purpose type. The middle is what I call the auto-removal types and the last column are the producer-consumer helpers. We'll look at what these terms mean in a few minutes. The ConcurrentDictionary is a thread-safe dictionary class. Each item in the dictionary has a key that identifies the item and the value of the item. Keys must be unique. It's not possible to have two items with the same key. When you have the key, you can retrieve the value associated with the key. So far, it sounds the same as a normal dictionary. It's just thread-safe. ConcurrentDictionary is the only concurrent collection that provides access to a…

Contents