ITPEC FE Morning April 2019 Question 18

Topic: SoftwareAlso asked in April 2024

In the figure below, data are sent continuously for T seconds from the send task to the receive task. When the volume of the data sent per second is S and volume of the data received per second is R, which of the following is an appropriate relational expression for buffer size L for a buffer that does not overflow? Here, the transmission speed for the send task is faster than the transmission speed for the receive task, and there is sufficient time between the transmissions.

Send taskBufferSize: LReceive taskSR

Explanation

L ≥ (S − R) × T — during the transfer the buffer fills at the difference between the sending and receiving rates.

Over T seconds the send task puts S × T into the buffer and the receive 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 time before the next transmission.

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.