I have a "single producer/single consumer" scenario implemented with new BlockingCollection
of .NET 4.0
.
The problem is that the producer thread awakes as soon as there's as a single space beocmes free in the collection. I want the producer to block until the consumer consumes at least half of the collection items. This is because producer speed is high and producing is expensive to the system.
How can I control the blocking condition for the producer?