Click here to Skip to main content
15,886,661 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Experts,

Can you please tell me the difference between BlockingCollection and ConcurrentBag?
Scenarios where which one is used.
Any resource where I got help for this question.

Thanks
Dinesh Sharma

What I have tried:

Can you please tell me the difference between BlockingCollection and ConcurrentBag?
Scenarios where which one is used.
Any resource where I got help for this question.
Posted
Comments
Pete O'Hanlon 14-Mar-16 6:26am    
Restating your question isn't telling us what you have tried. What reading have you done about this and what do you already know about it?
Er. Dinesh Sharma 14-Mar-16 6:53am    
I read that ConcurrentBag is non blocking collection and BlockingCollection is blocking
collection.in BlockingCollection there is BoundedCapacity property.And both collection
is inherited from IProducerConsumerCollection.

I want to know the difference between both.
Henrik Jonsson 14-Mar-16 16:17pm    
Next time, why not trying googling for "difference between BlockingCollection and ConcurrentBag" first. For me this led to the following Code Project Article that explain some usage scenarios: http://www.codeproject.com/Articles/181410/Thread-safe-Collections-in-NET

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900