ConcurrentHashSet icon indicating copy to clipboard operation
ConcurrentHashSet copied to clipboard

Implement IProducerConsumerCollection

Open i3arnon opened this issue 3 years ago • 4 comments

Should ConcurrentHashSet implement IProducerConsumerCollection?

i3arnon avatar Feb 23 '22 20:02 i3arnon

As per the doc, they now recommend it

TheDeadCode avatar Apr 08 '23 08:04 TheDeadCode

As per the doc, they now recommend it

What recommendation are you referring to?

i3arnon avatar Apr 17 '23 12:04 i3arnon

Oh gosh, it’s been awhile, it was in the Microsoft documentation in the concurrent collections docs. I’ll have to find it again this weekend

TheDeadCode avatar Apr 20 '23 01:04 TheDeadCode

The thing is that ConcurrentHashSet is different than the other collections. The difference between the rest is just the order of items. Would it make sense to add and take from a hashset based collection? In what order would TryTake return items?

For example ConcurrentDictionary doesn't implement the interface.. but they could've easily done it with key-value pairs.

i3arnon avatar Apr 20 '23 09:04 i3arnon