For single-producer, single-consumer should I use a BlockingCollection or a ConcurrentQueue?
- by Jonathan Allen
For single-producer, single-consumer should I use a BlockingCollection or a ConcurrentQueue?
Concerns:
* My goal is to pull up to 100 items at a time and send them as a batch to the next step.
* If I use a ConcurrentQueue, I have to manually cause it to go asleep when there is no work to be done. Otherwise I waste CPU cycles on spinning.
* If I…