ITPEC FE Subject A April 2024 Question 14
Data is continuously sent for T seconds from the sending task to the receiving task in the diagram below. When the volume of data sent in 1 second is S and the volume of data received in 1 second is R, which of the following is the appropriate relational expression indicating the buffer size L to prevent buffer overflow? Here, the sending task has a higher transfer speed than the receiving task, and there is a sufficient time interval until the start of the next transfer.
Explanation
L ≧ (S − R) × T — during the transfer the buffer fills at the difference between the sending and receiving rates.
Over T seconds the sending task puts S × T into the buffer and the receiving task takes R × T out. Since S > R, the buffer holds (S − R) × T at the end of the transfer, its peak. The buffer must be at least that large; it drains during the interval before the next transfer.
Answer (d)
Why not others:
- •(a) — R − S is negative because the sender is faster, and "<" points the wrong way
- •(b) — the right amount, but a buffer smaller than it overflows before the transfer ends
- •(c) — R − S is negative, so the bound holds for any buffer and prevents nothing
Key rule: A buffer between a fast producer and a slow consumer must hold (production rate − consumption rate) × burst length, and the gap between bursts must be long enough to drain it.
Software · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.