llq
A wait-free single-producer single-consumer linked-list queue with individually reusable nodes.
Queue operations do not block or allocate memory. Individual nodes are allocated and managed separately, and can be reused on multiple queues.
Examples
Using a queue to send values between threads:
use ;
let = new.split;
producer.push;
producer.push;
producer.push;
spawn.join.unwrap;
Reusing a node between multiple queues:
use ;
let = new.split;
let = new.split;
let node = new;
producer1.push;
let node = consumer1.pop.unwrap;
producer2.push;
let node = consumer2.pop.unwrap;
assert_eq!;
License
llq
is distributed under the terms of both the MIT license and the Apache license, version 2.0. Contributions are accepted under the same terms.