Content deleted Content added
m Reverted edits by 59.92.235.60 (talk) to last revision by Jdx: nonconstructive edits Tags: Rollback Reverted SWViewer [1.4] |
Tags: Manual revert Reverted |
||
Line 44:
In some situations, overwriting circular buffer can be used, e.g. in multimedia. If the buffer is used as the bounded buffer in the [[producer–consumer problem]] then it is probably desired for the producer (e.g., an audio generator) to overwrite old data if the consumer (e.g., the [[sound card]]) is unable to momentarily keep up. Also, the [[LZ77]] family of lossless data compression algorithms operates on the assumption that strings seen more recently in a data stream are more likely to occur soon in the stream. Implementations store the most recent data in a circular buffer.
== Circular buffer
:[[Image:Hardware_circular_buffer_implementation_patent_us3979733_fig4.png|250px|thumb|Circular buffer implementation in hardware, US patent 3979733, fig4]]
A circular buffer can be implemented using two [[pointer (computer programming)|pointer]]s and two integers:
|