Implement a ring buffer without locking.