Crate velocityx

Crate velocityx 

Source
Expand description

§VelocityX

A comprehensive lock-free data structures library designed for high-performance concurrent programming in Rust.

§🚀 Features

  • MPMC Queue: Multi-producer, multi-consumer bounded queue with zero locks
  • Concurrent HashMap: Lock-free reads with concurrent modifications using striped locking
  • Work-Stealing Deque: Chase-Lev deque for task scheduling and parallel workload distribution
  • Lock-Free Stack: Treiber’s algorithm stack with wait-free push and lock-free pop operations
  • Performance Metrics: Real-time monitoring with MetricsCollector trait across all data structures

§🎯 Philosophy

VelocityX focuses on providing:

  • Zero-cost abstractions with optimal performance
  • Comprehensive safety guarantees through Rust’s type system
  • Ergonomic APIs that guide users toward correct concurrent programming patterns
  • Extensive documentation and real-world usage examples
  • Production-ready performance monitoring and metrics collection

§⚡ Quick Start

use velocityx::{MpmcQueue, MetricsCollector};

let queue = MpmcQueue::new(100);
queue.push(42);
assert_eq!(queue.pop(), Some(42));

// Get performance metrics
let metrics = queue.metrics();
println!("Success rate: {:.2}%", metrics.success_rate());

§🔒 Thread Safety

All data structures in VelocityX are designed to be thread-safe and can be safely shared across threads without additional synchronization primitives.

§📊 Performance

VelocityX is optimized for modern multi-core processors with careful attention to:

  • Cache-line alignment and padding to prevent false sharing
  • Memory ordering semantics for correctness and performance
  • Contention minimization through lock-free algorithms
  • NUMA-aware design where applicable
  • Real-time performance monitoring with minimal overhead

Re-exports§

pub use crate::deque::work_stealing::WorkStealingDeque;
pub use crate::map::concurrent::ConcurrentHashMap;
pub use crate::metrics::MetricsCollector;
pub use crate::metrics::PerformanceMetrics;
pub use crate::queue::MpmcQueue;
pub use crate::stack::LockFreeStack;

Modules§

deque
Deque (double-ended queue) implementations
map
Map implementations
metrics
Performance Metrics Module
queue
Queue implementations for VelocityX
stack
Stack Module
util
Common utilities and helper types

Enums§

Error
Error types for VelocityX operations

Type Aliases§

Result
Result type for VelocityX operations