ConcurrentDictionary Is Not Always Thread-Safe

added by Paul Wheeler
1/17/2018 4:05:09 PM

1 Kicks, 336 Views

ConcurrentDictionary is a thread-safe dictionary implementation but surprisingly (at least to me) not all of its members can be safely used by multiple threads concurrently. The Thread Safety section on the ConcurrentDictionary MSDN article has this to say: All public and protected members of ConcurrentDictionary are thread-safe and may be used concurrently from multiple threads.