Producer and Consumer – Part I

This post deals with the implementation of a ring buffer (also called a circular buffer). The implementation shows a synchronization mechanism but it is NOT in use.

The typically case for a ring buffer is to act as a ‘buffer’ (hence its name) between one or more producers and possibly one or more consumers. The idea is to match the impedance between them.

Following is the test code written in Java using the Eclipse IDE: Continue reading “Producer and Consumer – Part I”