Fast and Best Producer/consumer queue technique BlockingCollection vs concurrent Queue [closed]

BlockingCollection and ConcurrentQueue are there for precisely this reason. I doubt that you’ll find anything better, or simpler to use. The parallel extensions team know their stuff 🙂

Just a quick check on versions though – you’re definitely using .NET 4, not just C# 4? (For example, you could be using Visual Studio 2010 and thus C# 4, but still targeting .NET 3.5, in which case you couldn’t use Parallel Extensions.)

You may also want to start researching Task-Based Asynchronous Pattern, TPL Dataflow and the async/await features of C# 5… obviously you can’t use them just yet, but it doesn’t hurt to know what’s coming up.

Leave a Comment