Reputation: 4117
What would be the most effective synchronized collection in .net for few producers (threads) and one consumer? Producing is much faster than consuming. Ordering is required.
Would it be just default BlockingCollection
on ConcurrentQueue
?
Upvotes: 0
Views: 84
Reputation: 73502
By default BlockingCollection
wraps ConcurrentQueue
when you didn't specify IProducerConsumerCollection<T>
in its constructor.
So whatever you choose to use is pretty same thing. With BlockingCollection
you get advantage of GetConsumingEnumerable
method which is deigned for consumer.
Upvotes: 1