C#中线程安全的HashSet
ConcurrentHashSet
<PackageReference Include="ConcurrentHashSet" Version="1.3.0" />
官方例子
var concurrentHashSet =
new ConcurrentHashSet<string>(
new[]
{
"hamster",
"HAMster",
"bar",
},
StringComparer.OrdinalIgnoreCase);
concurrentHashSet.TryRemove("foo");
if (concurrentHashSet.Contains("BAR"))
{
Console.WriteLine(concurrentHashSet.Count);
}
内容来源
www.nuget.org/packages/ConcurrentHashSet/
C#中线程安全的HashSet介绍
287

被折叠的 条评论
为什么被折叠?



