TryPress Step to fill the receive buffer and check its byte count while the consuming task remains paused.
Given a full receive buffer and a correctly decoded incoming byte, predict whether that byte will fit from the order of arrival and consumer service. Identify when a software receive-buffer overflow first occurs.
Serial buffers
Illustrative software receive buffer
UART decoder
→
Receive buffer
→
Consuming task
Receive buffer · Empty
EmptyFree slot
UART decoder
Framing matches and electrical levels are compatible.
Receive buffer
Empty. No overflow.
Consuming task
Paused.
The UART can decode bytes while the task that reads them is paused.
Illustrative software receive buffer
UART decoder
→
Receive buffer
→
Consuming task
Receive buffer · 64 bytes / 64 bytes
Retained bytesLast slot
Gapless burst · 19,200 bit/s, 8N1
First start bit to last stop bit ≈ 33.33 ms. Decoded bytes enter buffer immediately in this model.
Receive buffer
64 bytes / 64 bytes. No overflow.
With no reads during the burst, all 64 bytes fit and the buffer is full.
Illustrative software receive buffer
UART decoder
→
Receive buffer
→
Consuming task
Service before arrival
Next byte→Retained bytesOne slot free
Consumer read the oldest byte · No overflow
Service after arrival
Next byte→Retained bytesLast slot
Consumer paused · No overflow
Service before arrival
Oldest byte goes to the consumer. One slot free. Next byte still outside. No overflow.
Service after arrival
Consumer still paused. Buffer full. Next byte still outside. No overflow yet.
Which lane will accept the next byte?
The task has read a byte in one lane. In which lane will the next byte fit?
Illustrative software receive buffer
UART decoder
→
Receive buffer
→
Consuming task
Service before arrival
Retained bytesNext byte
Service after arrival
Retained bytesLast slot
Next byte Incoming byte discarded
Service before arrival
Next byte fills free slot. 64 bytes / 64 bytes. No overflow.
Service after arrival · Receive-buffer overflow
Discard incoming byte when full. Retained bytes stay in place.
The next byte fits where there is space. The full buffer discards the incoming byte under the displayed policy.
Illustrative software receive buffer
Reading after the overflow makes room for later arrivals. Pacing the source can give the consumer time to make room before an arrival.
Observe an empty buffer with a paused consumer
The UART can decode bytes while the task that reads them is paused.
ObserveAfter the 64-byte burst fills the buffer, the next byte takes the free slot in the early-read lane and appears beneath the full buffer as Incoming byte discarded in the late-read lane.
ExplainThe late read occurs after the correctly decoded byte arrives at a buffer already holding 64 bytes, so the illustrated overflow policy discards that incoming byte.
Technical boundaries. The gapless burst uses 19,200 bit/s and 8N1, with matching framing and compatible electrical levels. The model puts decoded bytes directly into the software buffer. The illustrated full-buffer policy keeps the bytes already stored and discards the new arrival.