C# 4.0 s new BlockingCollection doesn t answer a simple requirement we need:
* Concurrent-queue for tasks items.
* Consumers - limited N threads at a time - from the threadpool (threads which are not dedicated to this queue and are not blocked if there are no items in the queue).
especially useful for resources usage we need to limit with only one (N = 1) thread at a time and the queue can be empty from time to time.
I was looking for a nice solution with the new C# 4.0 parallel lib, leveraging the .Net internal threadpool. I can think of a few solutions for this, but I wonder if there s something elegant which I m missing.
你认为什么?
Regards, Shlomi