"thread-safe collection with no order and no duplicates" Code Answer


i suggest you use a concurrentdictionary and just use a dummy value for each entry. it's annoying in terms of efficiency (having all those dummy values) but i suspect in the majority of applications that would be insignificant.

you may well want to wrap this in your own concurrentset implementation, which just does enough for your purposes, so that you don't need to see the abstraction leakiness in much of your code.

By Oshan Wisumperuma on March 14 2022

Answers related to “thread-safe collection with no order and no duplicates”

Only authorized users can answer the Search term. Please sign in first, or register a free account.