concurrentdictionary

.NET - Dictionary locking vs. ConcurrentDictionary

穿精又带淫゛_ 提交于 2019-11-26 05:00:09
问题 I couldn\'t find enough information on ConcurrentDictionary types, so I thought I\'d ask about it here. Currently, I use a Dictionary to hold all users that is accessed constantly by multiple threads (from a thread pool, so no exact amount of threads), and it has synchronized access. I recently found out that there was a set of thread-safe collections in .NET 4.0, and it seems to be very pleasing. I was wondering, what would be the \'more efficient and easier to manage\' option, as i have the