C#

ConcurrentDictionary in C# – Introduction, Examples

ConcurrentDictionary is one of five collection classes introduced in.NET 4.0. It exists in System.Collections.Concurrent namespace. ConcurrentDictionary is a thread-safe collection class to store key-value pairs. ConcurrentDictionary can be used with multiple threads concurrently.  Without ConcurrentDictionary class, if we have to use Dictionary class with multiple threads, then we have to use locks to …

ConcurrentDictionary in C# – Introduction, Examples Read More
C#

ConcurrentQueue in C# – Introduction and Examples

C# ConcurrentQueue is a thread-safe collection class. It is introduced in .NET 4.0 with other concurrent collection classes. It provides a thread-safe First-In-First-Out (FIFO) data structure. You can read more about Queue here. ConcurrentQueue exists in System.Collections.Concurrent namespace ConcurrentQueue is a wrapper around generic Queue class. Queue class also provides FIFO data structure but …

ConcurrentQueue in C# – Introduction and Examples Read More