[][src]Crate magic_ring_buffer

#magic-ring-buffer

This is a Rust crate providing a magic ring buffer (also known as a virtual ring buffer, VRB, or mirrored buffer) which is lock-free for multiple producers and a single consumer.

A magic ring buffer allows 'wrap-around' of a ring buffer without the need to use two separate read or two separate writes; it exploits the fact that virtual memory does not need to be implemented using contiguous physical memory.

The current implementation only works on Android and Linux, as it relies on mapping anonymous shared memory in /dev/shm. It should be possible to make implementations that work on Mac OS X, the BSDs and Windows.

Structs

MagicRingBuffer

A magic ring buffer (also known as virtual ring buffer, VRB, or a mirrored ring buffer).

Enums

MirroredMemoryMapCreationError

An error that can occur during creation of a file descriptor instance.