.NET for added new concurrency features under System.Collection.Concurrent and some synchronization classes. Is there any good sample for single producer – single consumer pattern using these feature ? (Actually I will add a circular buffer pattern to it if it already doesn’t implement it as the shared buffer)
.NET for added new concurrency features under System.Collection.Concurrent and some synchronization classes. Is there
Share
The new type
BlockingCollection<T>(see MSDN) implements a producer/consumer pattern. It can be accessed by multiple producers/consumers concurrently, but it will work perfectly fine with a single producer and consumer too.