Crate mmap_sync

source ·
Expand description

mmap-sync is a high-performance, concurrent data access library for Rust. It is designed to handle data access between a single writer process and multiple reader processes efficiently using memory-mapped files, wait-free synchronization, and zero-copy deserialization.

Features

  • Memory-mapped files: This allows different processes to access the same memory space, bypassing the need for costly serialization and deserialization. As a result, mmap-sync provides fast, low-overhead data sharing between processes.

  • Wait-free synchronization: Inspired by Linux kernel’s Read-Copy-Update (RCU) pattern and the Left-Right concurrency control technique. Write access to the data is managed by a single writer, with multiple readers able to access the data concurrently.

  • Zero-copy deserialization: Leveraging the rkyv library, mmap-sync achieves efficient data storage and retrieval. The templated type T for Synchronizer can be any Rust struct implementing specified rkyv traits.

To get started with mmap-sync, please see the examples provided.

Modules

  • The guard module manages read access to shared memory, utilizing RAII (Resource Acquisition Is Initialization) principles to control access lifecycle.
  • The synchronizer module is the core component of the mmap-sync library, providing a Synchronizer struct for concurrent data access.