I am using a ConcurrentDictionary<string, List<CustomObjects>>
in a multi threaded environment.
Multiple threads are accessing the same dictionary for retrieving and modifying the item with unique key only. I mean although there are multiple threads accessing the dictionary each thread is accessing and modifying the element at unique key only.
At any point of time no situation will come that more than one thread are trying to access and modify the element at same key location.
Now my question is even in this case the internal locking happens? Or since the different threads are accessing different element at a time on same dictionary no internal locking or any concurrency mechanism execute?
I believe if more than one thread are trying to modify the element at same key location, by default locks will be executed and concurrency will be ensured. But if the different threads are accessing the different items within the dictionary, will it be done in lock free manner internally?