bbq-rs 0.1.1

A Block-based Bounded Queue for Exchanging Data and Profiling
Documentation
  • Coverage
  • 9.09%
    1 out of 11 items documented1 out of 1 items with examples
  • Size
  • Source code size: 22.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 677.42 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • YHM404

BBQ: A Block-based Bounded Queue for Exchanging Data and Profiling

This is a concurrent queue that supports multiple producers and multiple consumers. It is implemented based on the paper "BBQ: A Block-based Bounded Queue for Exchanging Data and Profiling" and can be used as follows:

Usage

Add bbq-rs to your Cargo.toml dependencies:

[dependencies]
bbq-rs = "0.1.1"

Example:

use bbq_rs::Bbq;  
use bbq_rs::BlockingQueue;  
  
fn main() {  
    let queue = Bbq::new(100, 100).unwrap();  
  
    // Create four producer threads  
    for i in 0..4 {  
        let q = queue.clone();  
        std::thread::spawn(move || {  
        q.push(i);  
    });

    // Create four consumer threads  
    for _ in 0..4 {  
        let q = queue.clone();  
        std::thread::spawn(move || {  
            println!("{}", q.pop().unwrap());  
        });  
    }
}