1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Queue implementations for VelocityX
//!
//! This module provides various queue implementations optimized for different use cases.
//!
//! ## Available Queues
//!
//! - [`MpmcQueue`]: Multi-producer, multi-consumer bounded queue
//!
//! ## Choosing a Queue
//!
//! - **Simple implementation**: Uses Mutex for thread safety
//! - **Memory ordering**: Basic atomic operations for head/tail tracking
//! - **Cache optimization**: Cache-line padding prevents false sharing
//! - **Comprehensive testing**: Unit tests included
//!
//! ## Performance Characteristics
//!
//! | Queue Type | Push | Pop | Memory | Contention |
//! |------------|------|-----|---------|------------|
//! | Bounded MPMC | O(1) | O(1) | Fixed | Low-Medium |
//!
//! ## Examples
//!
//! ```rust
//! use velocityx::queue::MpmcQueue;
//!
//! // Bounded queue for predictable memory usage
//! let bounded = MpmcQueue::new(1000);
//! bounded.push(42)?;
//!
//! # Ok::<(), velocityx::Error>(())
//! ```
// Re-export the main queue types
pub use ;
pub use MpmcQueue as LockFreeMpmcQueue;