Is there a C library that I can get these data structures for free?

ConcurrencyKit ck_ring. The SPSC macros are the most similar to this article:

https://github.com/concurrencykit/ck/blob/master/include/ck_...