gil 0.8.0

A collection of high-performance, lock-free concurrent queues (SPSC, MPSC, MPMC, SPMC) with sync and async support
Documentation
use gil::spsc::channel;
use std::{hint::black_box, num::NonZeroUsize, thread::spawn, time::SystemTime};

fn main() {
    let (mut tx, mut rx) = channel(NonZeroUsize::new(4096).unwrap());

    let start = SystemTime::now();

    const COUNTS: usize = 100_000_000;

    spawn(move || {
        for _ in 0..COUNTS {
            let x = rx.recv();
            black_box(x);
        }
    });

    for i in 0..COUNTS {
        tx.send(black_box(i));
    }

    let time = start.elapsed().unwrap();
    println!("{time:?}");
}