| ??? 12/27/07 13:28 Read: times |
#148789 - Beauty contest ! Responding to: ???'s previous message |
Tsuneo Chinzei said:
I don't think ring (cyclic) buffer is more beautiful than other buffering methods. To my knowledge the cyclic buffer is the only one that can easily handle streams of data. If it is designed in the right way the buffering can be done in a way that the interrupts can fill it "concurrently" while the main code is reading it. Actually the double buffer is just a two slot ring buffer with (usually) more than one byte "word" lenght. During my career I have designed and implemented a horde of protocols. The cyclic buffer seems to be the one that is flexible enough to be adaptable to almost any protocol. In protocol engines (state engines) one usually has several layers on top of each other. The architectural beauty is here the fact that the cyclic buffer is an atomic buffer - You can get one byte out of it - or not. Other kind of buffers tend to bring structural complexity to this layer - and that is not a thing I would call beautiful. |



