Glossary · Automation software engineering and architecture
Ring buffer
Also known as: Circular queue
German: Ringpuffer
In programming, a ring buffer is a fixed-size buffer used as if its end were connected to its beginning, with separate read and write positions, so that data is written and read continuously without moving elements.
- Software engineering
In one sentence
A ring buffer is a fixed-size buffer whose end wraps to its start, with separate read and write positions for continuous data flow.
Example
The data logger stores the last 10,000 measurement samples in a ring buffer, so when a fault occurs the values leading up to it are available.
How it applies
- Engineering: Ring buffers have constant-time operations and fixed memory, which suits real-time and embedded code. With one producer and one consumer they can be implemented without locks.
- Diagnostics: Trace and fault recorders use ring buffers to keep the most recent history, overwriting the oldest data. Designers decide whether a full buffer overwrites old data or rejects new data.
- Documentation: For diagnostic buffers, document the capacity, sampling rate, resulting time window and what happens when the buffer is full, so service staff know how quickly to save data after a fault.
Ring buffer vs. circular buffer
The terms are synonyms in most usage. This entry keeps both names because the client's term list lists them separately; see Circular buffer.