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

Unlock this course with a free trial

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

Compare standard and concurrent collections

Compare standard and concurrent collections - C# Tutorial

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

Compare standard and concurrent collections

- [Narrator] We're seeing that for multiple threaded code, it is better to use the concurrent collections. Given this, it is a good idea to compare the Standard Collections with the Concurrent ones. To be clear, this comparison is with the Standard Generic Collections. The older, non-generic ones are outdated. Consider removing them from your code base. Here is a list of the collection classes in the System.Collections.Generic Namespace. I'm sure you see ones that you use all the time. First and foremost is the list of List of <T> Type. The workhorse for so many applications. Then there are so many other list Classes, like SortedList, and LinkedList. There are the common Queue and Stack Classes, plus a few set Classes and some Dictionary Classes. There are not as many Types in the Concurrent Collections Namespace. Really, there are only these five main Types. We have ConcurrentDictionary, and then ConcurrentQueue, Stack…

Contents