|
loon
High-performance header-only C++ library for low-latency applications
|
A lock-free single-producer single-consumer (SPSC) queue with fixed capacity. More...
#include <spsc.hpp>
Public Member Functions | |
| size_t | capacity () const |
| Returns the maximum number of elements the queue can hold. | |
| bool | empty () const |
| Checks if the queue is empty. | |
| bool | full () const |
| Checks if the queue is full. | |
A lock-free single-producer single-consumer (SPSC) queue with fixed capacity.
SpscQueue provides O(1) push and pop operations without locks, suitable for communication between a single producer thread and a single consumer thread. The capacity is fixed at compile time and the queue will reject new elements when full.
|
inline |
Returns the maximum number of elements the queue can hold.
|
inline |
Checks if the queue is empty.
|
inline |
Checks if the queue is full.