Crate chute

Source
Expand description

Multi-producer multi-consumer lock-free multicast1 queue.

Memory-wise all consumers works with the same shared data blocks, so there is no duplication.

Read performance is stellar - there is only one atomic read per block. Most of the time - this is just plain continuous data reading.

§spmc vs mpmc

Both, spmc and mpmc can work in multi-producer mode.

In general, using Arc<spin::Mutex<spmc::Queue<T>>> is more performant than Arc<mpmc::Queue<T>> from writer perspective. But! Writing simultaneously from several threads is faster with mpmc.

Read performance identical.


  1. Each consumer gets every message sent to queue, from the moment of subscription. 

Modules§

  • Multi-producer, multi-consumer.
  • Single-producer, multi-consumer.

Structs§

Traits§