In C#, can multiple threads read and write to a Dictionary provided each thread only accesses one element in the dictionary and never accesses another?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, a Dictionary is not Thread-safe.
With the exception of modifying the contents of a reference type (object) that is stored as the Value in a dictionary.
In .NET 4 we will have
System.Collections.Concurrent.ConcurrentDictionary.