C# Corner
Tech
News
Videos
Forums
Trainings
Books
Live
More
Interviews
Events
Jobs
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
BlockingCollection and IProducerConsumerCollection in C#
WhatsApp
Sandeep Gupta
11y
11.3
k
0
1
25
Blog
Hi Folks,
Here we are learning what is Producer-consumer problem in C#.
BlockingCollection<T>
is a thread-safe collection class that provides the following features:
An implementation of the Producer-Consumer pattern.
Concurrent adding and taking of items from multiple threads.
Optional maximum capacity.
Insertion and removal operations that block when collection is empty or full.
Insertion and removal "try" operations that do not block or that block up to a specified period of time.
Encapsulates any collection type that implements
IProducerConsumerCollection<T>
Cancellation with cancellation tokens.
Two kinds of enumeration with
foreach
(
For Each
in Visual Basic):
- Read-only enumeration.
- Enumeration that removes items as they are enumerated.
Read More about this, please refer this
link
.
People also reading
Membership not found