A ConcurrentHashSet implementation
Switch branches/tags
Nothing to show
Clone or download
Latest commit 24ed105 Apr 15, 2018
Permalink
Failed to load latest commit information.
src Bump version to 1.0.2 Jul 17, 2017
.gitignore Hide ConcurrentCollections.xml Mar 25, 2017
LICENSE Update LICENSE (#9) Apr 15, 2018
README.md Add nuget & downloads shields Jan 7, 2018

README.md

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);
}