Is the ConcurrentDictionary thread-safe to the point that I can use it for a static cache?
问题 Basically, if I want to do the following: public class SomeClass { private static ConcurrentDictionary<..., ...> Cache { get; set; } } Does this let me avoid using lock s all over the place? 回答1: Yes, it is thread safe and yes it avoids you using locks all over the place (whatever that means). Of course that will only provide you a thread safe access to the data stored in this dictionary, but if the data itself is not thread safe then you need to synchronize access to it of course. Imagine