Note, there is Peter's C atomics ringbuffer.c implementation from libpd now in the Pd sources. It's limited to lengths of a multiple of 256 bytes I believe but easy to use.
I have used it successfully in the iOS Audio Unit to handle differing input and output buffer sizes due to sample rate conversion outside libpd.