change serial buffer size or make it LIFO

Hey All,

I'm using two arduinos with xbee point-to-point wireless serial communication. arduinoA is constantly sending data. arduinoB reads a byte, does some work, then reads another byte. The problem is that communication is too slow. I want arduinoB to immediately get the most recent byte sent on its first Serial.read() after returning from work. I think what is happening right now is that arduinoB has to read thgouh the entire 128 byte buffer before getting the "curent" byte. I don't care about loosing data (don't care about what data was transmitted while arduinoB was working), I just want to instantly get whatever byte arduinoA is sending. Is there a way to do this?
I thought mayby there was a way to make the serial buffer only 1 byte in size, or to make it LIFO instead of FIFO.

Any help is greatly appreciated

Francis

You could flush the serial buffer, and then wait for the next byte to arrive.

Or you have the sender send data only when the receiver if ready to read it. The receiver would send an "I'm waiting!" type message. The sender would see that there was serial data, read the data, see that it was the "I'm waiting!" message, and then send the current data.