I have a dictionary only supports add
and modify
operations and can be concurrently operated, but always for different keys. Keys are int and values are a reference type. Also modify means change some properties of a value.
My questions are:
- Do I need to use ConcurrentDictionary in this scenario? If needed, how does it help?
- If concurrent modification can happen on the same key, will ConcurrentDictionary help to ensure thread safty? My understanding is no, is that correct?
Thanks!