开发者

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

开发者 https://www.devze.com 2023-03-12 04:37 出处:网络
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 thre

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

精彩评论

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