ringbuffer的特别之处

在这里插入图片描述
嗯,正如名字所说的一样,它是一个环(首尾相接的环),你可以把它用做在不同上下文(线程)间传递数据的buffer。

我们实现的ring buffer和大家常用的队列之间的区别是,我们不删除buffer中的数据,也就是说这些数据一直存放在buffer中,直到新的数据覆盖他们。这就是和维基百科版本相比,我们不需要尾指针的原因。ringbuffer本身并不控制是否需要重叠(决定是否重叠是生产者-消费者行为模式的一部分–如果你等不急我写blog来说明它们,那么可以自行检出Disruptor项目)。

U2FsdGVkX192idVxJAAFaMGC34ObSN96QqDxxj5xl9F8RBfrW9tZibY89ve6z+jR
DTl5CX5Wrz02fzoJkWyppAg8YF2qOCvBWYsRzLRlYrVUu7QSbxJoMrKsF2DNhZH/
uwBYv9oiZkiCG5a07K2RBWJejnn2nnXjjFRSFYItwP0GckcyYMuvvZdtbpa//O3l
3jT+j/5JEi4jAC5ZrKTydBGBGJlC0UsUa9YTIWEFLl/S9Aggx21/ZRs4+BevI0i0
pD3EGQ5k8+EfihPnVwMNv/4ndJ7Jm7RJlkS1aD2ny1OQ/kXc3jgAJM4XMFhDWGdq
DQ17yfPKElrpMMkh2nTmdw2SMi7ra36m7Igcr+dHbz2I+ZWlnk2oOMlIcH/eCTXj
S56hBIulvnOpzEzX6Idl6wv37buxVhlQ/G+Y8ZhWfnnPRRlW9ccIm0c9Y+p8CwcE
5qUZ82JQJnRVNlns3N32Jd7ijR6j71H2wQY5ACVM60FNTaZhD5ZJZk5nUwCHu+5C
AnfmskTZGTCmJzA6NgQnyzJgcS+aCG1AZrkAWX1eyGrO7y23jzEifWXT8qF9mn7v
aIsVJaV/S3zBHqCkZgil0Asaj38/8LeeR8NHHnQ2iTpCdhnRIyzKw2YuBJ5NjqEV
o71qr+a9gUX3miIrw5kaMYcFg90yck7p68cFaH1bfXKIgIylwUjp7TzDSn1lQ7s1
HkHVysFBDGZe43Lerqg87C6WTK1QelpNls3PzgMTRs948IXuM0dojsjqshvJo4xo
jtL1me+g7StOKHPY9sefjfpmpBI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