Read buffer size vs. internal queue size
Posted: Wed Feb 02, 2011 10:33 am
Okay, I've got things worked out now, and I think everything is going to work out with my serial port issues.
But it has gotten me thinking: what is a good relationship between the size of the internal serial port read queue, and the read buffer in the application code?
Assuming the reading call is issued frequently enough (so that the internal queue never overflows before another read is issued), is there ever a situation where, during the read call, a new byte can come in on the serial port, and overwrite something in the internal queue (or get dropped) (that is, while the current data in the internal queue is being copied to the read buffer)?
But it has gotten me thinking: what is a good relationship between the size of the internal serial port read queue, and the read buffer in the application code?
Assuming the reading call is issued frequently enough (so that the internal queue never overflows before another read is issued), is there ever a situation where, during the read call, a new byte can come in on the serial port, and overwrite something in the internal queue (or get dropped) (that is, while the current data in the internal queue is being copied to the read buffer)?