L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
ring_buffer File Reference

Shared-memory multiple-producer multiple-consumer head-drop ring buffer implementation. More...

#include <cstddef>
#include <stdexcept>
#include <atomic>
#include <bit>
#include <mutex>
#include <functional>
Include dependency graph for ring_buffer:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  utrace::Ring_buffer< SEQUENCE_TYPE >
 Ring buffer. More...
class  utrace::Ring_status< SEQUENCE_TYPE >
 Ring buffer status area. More...
class  utrace::Ring_slot< ITEM_TYPE, GENERATION_PTR >
 Ring buffer slot. More...
class  utrace::Ring_buffer_producer< SEQUENCE_TYPE, ITEM_TYPE, GENERATION_PTR >
 Ring buffer producer. More...
class  utrace::Ring_buffer_consumer_raw< SEQUENCE_TYPE, ITEM_TYPE, GENERATION_PTR >
 Polling ring buffer consumer. More...
class  utrace::Ring_buffer_consumer< SEQUENCE_TYPE, ITEM_TYPE, GENERATION_PTR >
 Blocking ring buffer consumer. More...

Detailed Description

Shared-memory multiple-producer multiple-consumer head-drop ring buffer implementation.

This implements a generic ring buffer for transferring fixed-sized items in shared memory between producers and consumers without coupling. This means that the pace of producers is never affected by the pace of consumers (producers never block and never wait for the consumers).

When consumers are unable to dequeue items from the ring buffer quickly enough, they lose access to the oldest items (head-drop policy), but this condition is always detected.

When there are more producers than the total number of items actively enqueuing items into the ring buffer, the state of the ring buffer is undefined. When the sequence/generation counter of the items in the ring buffer overflow, the state of the ring buffer is undefined.

Definition in file ring_buffer.