2 ms·
It depends on what the queue is being used for. If a queue is just being used to decouple a producer/consumer pair, then "it should be [almost] empty" is a rea
by HarHarVeryFunny 4y ago
It depends on what the queue is being used for.
If a queue is just being used to decouple a producer/consumer pair, then "it should be [almost] empty" is a reasonable notion, assuming consumer/producer are compute bound and there's no fundamental reason why one should be faster than the other...
Which brings us to the other type of use where things are being enqueued specifically as a means of waiting for resources that are in limited supply: maybe just compute if these are computationally heavy jobs, or maybe I/O bandwidth, etc. In that case we expect the queue to often be non-empty, and there's nothing wrong with that, even if there's potential to throw money/hardware at it to get the queue size down to zero!