Using a thread-safe dictionary in .NET C# Part 3: thread-safe modifications
July 31, 2015 Leave a comment
In the previous post we looked at the 4 Try methods of ConcurrentDictionary that support CRUD operations: retrieval, deletion, update and insertion. We saw some basic examples for their usage and concluded that TryUpdate was not a very good solution to actually update an item due to race conditions.
This is where another method called AddOrUpdate enters the scene.