| Crates.io | lprq-rs |
| lib.rs | lprq-rs |
| version | 0.1.0 |
| created_at | 2025-06-19 14:07:26.744297+00 |
| updated_at | 2025-06-19 14:07:26.744297+00 |
| description | A Rust implementation of the LPRQ |
| homepage | https://github.com/WilleBerg/lprq-rs |
| repository | https://github.com/WilleBerg/lprq-rs |
| max_upload_size | |
| id | 1718407 |
| size | 852,603 |
lprq-rs is a Rust implementation of the LPRQ. It is a very fast concurrent lock-free queue, outperforming most, if not all, other popular Rust concurrent queues at higher thread counts.
use lprq_rs::LPRQueue;
fn main() {
let q: LPRQueue<i32> = LPRQueue::new();
q.enqueue(1);
assert_eq(q.dequeue(), Some(1));
}
lprq-rs was benchmarked using the rusty-benchmarking-framework.
It performs a lot better than all other concurrent queues benchmarked after 6 threads for τ = 0.5 and 0.7. The poor performance for for τ = 0.3 is probably due to no optimisation for the empty queue, however that is planned to be implemented.

Here are results from three different benchmarks using varying tau (τ) values to control the enqueue/dequeue ratio.
Benchmark Setup: Threads are synchronized to start simultaneously, with each thread alternating between enqueue and dequeue operations based on a random number r ∈ [0,1) - enqueueing when r > τ, dequeueing otherwise. Additional random operations simulate realistic workloads between each queue operation.
For implementation details, see the rusty-benchmarking-framework.