I have a question about ConcurrentDictionary.
I have the following:
public ConcurrentDictionary
There are two ways of adding data.
myDictionary["SomeKey"] = "Some value"
and
myDictionary.TryAdd("SomeKey", "Some value");
Are both method threadsafe. I mean if two processes try to access the dictionary at the same time, it will not throw an exception?
Thanks

VulpesRank #55 · 29.2K reputationPosted May 3, 2012, 1:54 AM EDT
Antonios Dev37 reputationPosted May 3, 2012, 5:48 AM EDT