AcidJunkie
AcidJunkie

Reputation: 1918

Why does BlockingCollection<T> not implement ICollection<T>?

The current implementation looks like this:

public class BlockingCollection<T> : IEnumerable<T>, ICollection, IEnumerable, IDisposable

Does anyone have an idea why it does not implement ICollection<T> as well? It's kind of anoying...

Upvotes: 1

Views: 136

Answers (1)

paparazzo
paparazzo

Reputation: 45096

For one it does not implement ICollection.Contains Method (T)
As commented by Hans Contains() method cannot be implemented in an efficient thread-safe way.

Upvotes: 1

Related Questions