To recap for those .NET gurus who might not know the Java API:
ConcurrentHashMap in Java has atomic methods (i.e. require no external locking) for common Map modification operations such as:
putIfAbsent(K key, V value)
remove(Object key, Object value)
replace(K key, V value)
It also allows iteration over the keyset without locking (it takes a copy at the start of iteration) and get()
operations can generally be interleaved with calls to put()
without blocking (it uses fine grained lock striping IIRC).
Anyway, my question is: does .NET have an equivalent Dictionary implementation?
I guess more generally, I'd be keen to know if .NET has a more general set of thread safe collection libraries. Or concurrency utilities in general - equivalent to Doug Lea's java.util.concurrent
libraries.