Will a FIFO buffer eventually stagnate?

57 Views Asked by At

Below depicts a FIFO buffer:

stagnate

So the buffer is there for when the speed of data written into the FIFO buffer is faster than the data read.

But I don't understand one thing. Wouldn't eventually all the free buffers of the FIFO buffer run out after certain amount of time? Because writing speed is faster than the read speed.

And if it will stagnate, what is the purpose of using it?

2

There are 2 best solutions below

0
ash On

Given there is no implementation to discuss, this is all theoretical. So yes, depending on the resources and the rates of production and consumption, it is possible the buffer resources will be exhausted.

The results of an exhausted buffer depend on the implementation and possibly settings there.

Buffering won't make consumption faster, but it allows consumers to process the incoming data less urgently, allowing for bursts of production and/or consumption.

0
Aykhan Hagverdili On

FIFO is an abstract description of handling data. The exact details of how edge cases and limitations are handled are implementations details. A particular implementation could block the further input until there is more room in the buffer, or it could ignore everything after the buffer is full, or it could fail/terminate with an error message. It's entirely up to the implementation.