> And now I think I can see how a counter can help. Hmm. Does your counter > ever decrement under '0' and exceed RING_LENGTH by 1 or not ? My producer code tests for the full condition before adjusting any of the variables. Similarly my consumer code tests for the empty condition first. The counter value is never out of range. Note that in my implementation the counter is not adjusted by the macros I've mentioned previously, so it is still up to the programmer to remember to do things in the right order. This could be fixed by having separate macros to advance the head and tail pointers; right now I just use a single macro for either one. Cheers, Eric