Why does iterating over GetConsumingEnumerable() not fully empty the underlying blocking collection
问题 I have a quantifiable & repeatable problem using the Task Parallel Library, BlockingCollection<T> , ConcurrentQueue<T> & GetConsumingEnumerable while trying to create a simple pipeline. In a nutshell, adding entries to a default BlockingCollection<T> (which under the hood is relying on a ConcurrentQueue<T> ) from one thread, does not guarantee that they will be popped off the BlockingCollection<T> from another thread calling the GetConsumingEnumerable() Method. I've created a very simple