lowlet

Crates.iolowlet
lib.rslowlet
version0.1.2
created_at2026-01-09 13:06:17.920807+00
updated_at2026-01-10 07:52:31.130067+00
descriptionLow-latency IPC library using shared memory and lock-free structures
homepagehttps://codeberg.org/sun4ll/lowlat-ipc
repositoryhttps://codeberg.org/sun4ll/lowlat-ipc
max_upload_size
id2032045
size118,661
(sun4ll)

documentation

https://docs.rs/lowlet

README

lowlet

Low-latency inter-process communication library for Rust.

Features

  • Shared memory regions with automatic cleanup
  • Lock-free SPSC queue and MPMC ring buffer
  • Inline assembly memory fences and atomics (x86_64)
  • TTAS spinlock with pause instruction
  • Process synchronization barrier
  • Batch send/receive operations
  • Timeout-based operations
  • Channel statistics and metrics

New in 0.1.2

  • RwLock: Multiple readers, single writer lock
  • Semaphore: Counting semaphore with acquire/release
  • SeqLock: Optimistic read locking for read-heavy workloads
  • Broadcast Channel: One-to-many message delivery
  • Priority Queue: Lock-free min-heap implementation
  • Object Pool: Pre-allocated slots for reduced allocation overhead
  • Zero-copy API: send_in_place() and recv_in_place() methods
  • Latency Histogram: HDR histogram with p50/p90/p99/p999 percentiles
  • Channel Health: Real-time utilization and saturation monitoring
  • Graceful Shutdown: close() and is_closed() methods
  • Additional Methods: is_full(), drain(), peek()

Installation

[dependencies]
lowlet = "0.1.2"

Quick Start

use lowlet::channel;

fn main() {
    let (tx, rx) = channel::<u64, 1024>();
    
    tx.send(42).unwrap();
    let value = rx.recv().unwrap();
    
    assert_eq!(value, 42);
}

Broadcast Example

use lowlet::broadcast;

fn main() {
    let (tx, rx1) = broadcast::<u64, 64>();
    let rx2 = tx.subscribe();
    
    tx.send(100).unwrap();
    
    assert_eq!(rx1.recv().unwrap(), 100);
    assert_eq!(rx2.recv().unwrap(), 100);
}

Documentation

Performance

  • ~61 cycles per send/recv operation
  • ~20ns latency at 3GHz
  • Zero-copy message passing
  • Lock-free algorithms

License

MIT OR Apache-2.0

Commit count: 9

cargo fmt