2.4.3.1 Definition¶
-
typedef struct ZixRingImpl ZixRing¶
A lock-free ring buffer.
Thread-safe (with a few noted exceptions) for a single reader and single writer, and realtime-safe on both ends.
-
ZixRing *zix_ring_new(ZixAllocator *allocator, uint32_t size)¶
Create a new ring.
- Parameters:
allocator – Allocator for the ring object and its array.
size – Size of the ring in bytes (note this may be rounded up).
At most
size
- 1 bytes may be stored in the ring at once.
-
ZixStatus zix_ring_mlock(ZixRing *ring)¶
Lock the ring data into physical memory.
This function is NOT thread safe or real-time safe, but it should be called after
zix_ring_new()
to lock all ring memory to avoid page faults while using the ring.