lowlet/sync/mod.rs
1//! Synchronization primitives for low-latency applications.
2//!
3//! This module provides:
4//!
5//! - [`Spinlock`] - A simple spinlock with RAII guard
6//! - [`Barrier`] - Thread barrier for coordination
7//! - [`asm::atomic`] - Low-level atomic operations via inline assembly
8//! - [`asm::fence`] - Memory fences and timing utilities (RDTSC)
9//!
10//! # Architecture
11//!
12//! All primitives are designed for `x86_64` and use cache-line alignment
13//! to prevent false sharing. The `asm` submodule provides direct access
14//! to CPU instructions for maximum performance.
15
16pub mod asm;
17mod barrier;
18mod spinlock;
19
20pub use asm::{atomic, fence};
21pub use barrier::Barrier;
22pub use spinlock::{SpinGuard, Spinlock};