Circular Buffer – Part I

A circular buffer is an object used to ‘buffer’ data between Producer and Consumer. If the consumer is faster than the consumer, perhaps an intermediate object like a circular buffer would not be needed. If such condition cannot be guaranteed, then a circular buffer might be what the doctor ordered.

When I decided to write about this subject, I quickly went and designed and implemented a complete solution in C. Last night I decided that was not a good idea. Instead let’s start very simple with the basics and gradually increase the complexity of the solution as requirements evolve. I believe that is one of the main ideas for Agile. If you are an experienced software developer then you would immediately see the need for additional functionality in the initial implementation. In addition, depending on what the requirements are, several additional features might be required. I am not planning on spending a few days on this topic so I will try to get multiple implementations to some degree of functionality. Continue reading “Circular Buffer – Part I”