Crates.io | ev_slotmap |
lib.rs | ev_slotmap |
version | 0.2.1 |
source | src |
created_at | 2020-06-25 00:23:15.940248 |
updated_at | 2020-08-31 01:03:44.834112 |
description | A lock-free, eventually consistent, concurrent slot map. |
homepage | |
repository | https://github.com/rookandpawn/ev_slotmap.git |
max_upload_size | |
id | 257729 |
size | 57,229 |
A lock-free, concurrent slot map.
Most of this library is a rip off of Jon Gjengset's evmap but with a few notable simplifications
The core synchronization component's of evmap are still present. Out of simplicity, we also use the ShallowCopy straight out of evmap instead of copy-pasting it in. Also the following blurb is almost straight from evmap.
This map implementation allows reads and writes to execute entirely in parallel, with no
implicit synchronization overhead. Reads never take locks on their critical path, and neither
do writes assuming there is a single writer (multi-writer is possible using a Mutex
), which
significantly improves performance under contention.
Unlike evmap which provides eventual consistency following explicit refresh
calls, synchronization between reads and writers happens before write methods return. For read-heavy workloads, the scheme used by this module is particularly useful. Writers can afford to refresh after every write, which provides up-to-date reads, and readers remain fast as they do not need to ever take locks.
Benchmarks to come