If, on average, B consumes at half the rate that A produces, there is no finite-size queue such that A will never stall.
maddy
The size of the queue/buffer required might differ based on the variance in the length of the tasks(higher variance needing bigger queues) as well as the rate at which the producer and consumers operate.
POTUS
Without a queue, whenever A is done with an item, it has to hand it off output to B before it can start on the next thing. If B is not yet done with item 1, it can't start on item 2. This creates a stall in A.
paracon
Queues are used to improve the efficiency of the different systems that work together.
If, on average, B consumes at half the rate that A produces, there is no finite-size queue such that A will never stall.
The size of the queue/buffer required might differ based on the variance in the length of the tasks(higher variance needing bigger queues) as well as the rate at which the producer and consumers operate.
Without a queue, whenever A is done with an item, it has to hand it off output to B before it can start on the next thing. If B is not yet done with item 1, it can't start on item 2. This creates a stall in A.
Queues are used to improve the efficiency of the different systems that work together.