Hashtable and Dictionary thread safety considerations
msdn.com » 2008 » March » 15th » Hashtable and Dictionary thread safety considerations
Tagged: collections
Let’s start with the basics: System.Collections.Hashtable is multiple-reader, single-writer threadsafe. System.Collections.Generic.Dictionary has no thread safety guarantees. Consider a class that has a Dictionary member, and assume that multiple threads may access it simultaneously. Taking a lock is expensive, so what do you think about the following attempt to defer taking a lock? class … Continue Reading »