browse by category or date

Hi there! I am still slowly reading this book:

Today I reached a page where the book is explaining about collections. Among the types of collections available, I am intrigued that there is a namespace called System.Collections.Concurrent. Apparently, .NET now has a number of collection types under this namespace:

  1. BlockingCollection<T>
  2. ConcurrentBag<T>
  3. ConcurrentDictionary<TKey,TValue>
  4. ConcurrentQueue<T>
  5. ConcurrentStack<T>

Then I found out that it has been around since 2010!

It was introduced together with .NET 4, God darn it! It does make me feel like I’ve been living under a rock. I could have been using these classes instead of manually locking and waiting in my past projects. So in my attempt to catch up, these articles helped me to quickly understand these Concurrent Classes:

  1. ConcurrentBag<T> used to be slow, but Microsoft has fixed this
  2. When to use the new Concurrent Classes, and when to resort back to the classic manual locking and waiting
  3. Good introduction to Concurrent Classes
  4. Microsoft’s White Paper on the performance of Concurrent Classes
  5. Understanding what happen under ConcurrentBag<T>

That’s it for now. I’ll post more on this subject as I explore on their usage in real-life scenario.

GD Star Rating
loading...
TIL: System.Collections.Concurrent namespace, 3.0 out of 5 based on 1 rating

Possibly relevant:

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Incoming Search

.net, c#, concurrency

No Comment

Add Your Comment