Event-driven .NET: Concurrent Producer/Consumer using a non-blocking, async queue

In a previous article I wrote about how to implement concurrent producer/consumer using a BlockingCollection. This is a thread-safe, event-driven approach that uses high-level concurrent constructs. The only downside is that the consumer uses a blocking call to dequeue messages. In other words, it wastes a thread. Is there a way to implement this using … Read more Event-driven .NET: Concurrent Producer/Consumer using a non-blocking, async queue

Event-driven .NET: Concurrent Producer/Consumer using BlockingCollection

With the Producer/Consumer pattern you have one or more threads producing new work and enqueuing it, and one or more threads consuming that work by dequeuing it and processing it. The consumers and producers share access to the work queue. Think of it like the Post Office. You have one or more people (producers) dropping … Read more Event-driven .NET: Concurrent Producer/Consumer using BlockingCollection