Lockless circular buffer in a Single-Producer Single-Consumer scenario.
clang buffer.c -o buffer -pthread
./buffer
Every buffer node has a void* pointer and a status volatile boolean which indicates whether the node has been read or not.
reader and rriter can use this status flag to determine whether the buffer is full or not.
For demonstrating purposes, the writer puts in the buffer random integer and the reader simply prints it to stdout