开发者

Is bool ConcurrentDictionary<TKey, TValue>.TryGetValue(TKey, out TValue) method thread-safe?

It's not quite clear from this post: https://devblogs.microsoft.com/pfxteam/concurrentdict开发者_开发百科ionarys-support-for-adding-and-updating/


Sure. Otherwise it would be useless, as this is a thread safe alternative to Dictionary<TKey, TValue>. See the documentation: http://msdn.microsoft.com/en-us/library/dd287191.aspx:

Thread Safety

All public and protected members of ConcurrentDictionary<TKey, TValue> are thread-safe and may be used concurrently from multiple threads.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜