Skip to main content

Module sync

Module sync 

Source
Expand description

Synchronization primitives with loom support for concurrency testing.

This module provides type aliases that switch between standard library sync primitives and loom’s mocked versions based on the loom feature flag.

§Usage

use velesdb_core::sync::{Arc, RwLock, Mutex};

// Works with both std and loom
let data = Arc::new(RwLock::new(42));

§Testing with Loom

cargo +nightly test --features loom --test loom_tests

§EPIC-023: Loom Concurrency Testing

Modules§

thread
Native threads.

Structs§

Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.

Enums§

Ordering
Atomic memory orderings

Type Aliases§

AtomicU64
An integer type which can be safely shared between threads.
AtomicUsize
An integer type which can be safely shared between threads.
Mutex
A mutual exclusion primitive useful for protecting shared data
RwLock
A reader-writer lock