Hello,
I'm streaming in message data into a bunch of arrays. For example, I have a 15-byte message that I have in arrays named after what each byte means:
ByteONE0-255
ByteTWO0-255
...
Each time I read a message, I MOVER the range, e.g. move 255 bytes from ByteONE0 to ByteONE1, and plop the new message into the the zeroth position.
So I've got a FIFO queue .. what's the best way to read it? I've created an auxiliary array, MsgProcStat0-255, that I can use to store status info, like 0="unprocessed", 1="read and processed", 2="read and error", etc.
So I need to start at the end of the array and move forward, processing messages as they need to be. How do I:
a) Do this quickly
b) Avoid race conditions where a message is inserted while the processor moves to the next message that needs to be processed?
Given the message receipt rate, I could probably get away with requiring processing before the next message is read, but this doesn't seem like the most elegant solution. I'm sure this is an age-old problem.
Thanks,
Colin