Skip to content

huster-songtao/ConcurrentHashSet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ConcurrentHashSet

NuGet NuGet license

A ConcurrentHashSet implementation based on .NET's ConcurrentDictionary

This implementation supports basic operations per item without HashSet's set operations as they make less sense in concurrent scenarios IMO:

var concurrentHashSet =
    new ConcurrentHashSet<string>(
        new[]
        {
            "hamster",
            "HAMster",
            "bar",
        },
        StringComparer.OrdinalIgnoreCase);

concurrentHashSet.TryRemove("foo");
if (concurrentHashSet.Contains("BAR"))
{
    Console.WriteLine(concurrentHashSet.Count);
}

About

A ConcurrentHashSet implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%