ring buffer for share memory