Could someone show me how to write a circular buffer in C.
Basically my program will have multiple threads and all have to use the same buffer, some threads write to it others read, and others modify.

The syncronization is not too hard, i just cant find a circular buffer example anywhere, to see how it works.