Crates.io | mmap-append |
lib.rs | mmap-append |
version | 0.2.0 |
source | src |
created_at | 2023-07-29 23:49:05.903655 |
updated_at | 2024-02-21 01:52:15.610995 |
description | Append-only memory-mapped I/O, resizable, with low lock contention |
homepage | |
repository | https://github.com/mikedilger/mmap-append |
max_upload_size | |
id | 929615 |
size | 13,556 |
This is a memory mapping crate for unix only.
It derives from the mmap
crate, and provides a resizable append-only map with very low lock contention. RwLock<MmapMut>
from the mmap
crate works, but writers block readers and readers block writers. In our implementation, only writers block writers, or they block everything during a resize. the mmap
crate doesn't offer resize functionality.
It uses an interior lock to prevent two different processes from appending at the same time, and a different interior lock to get exclusive access during the resize, which may change the virtual address of the map. The virtual address of the map changing should not matter to callers who access the memory via slices, and there can be no active borrowed slices when the resize happens due to the locking mechanism.