Crate testbench

Source
Expand description

Testing and benchmarking tools for concurrent Rust code

This crate groups together a bunch of utilities which I’ve found useful when testing and benchmarking Rust concurrency primitives in the triple_buffer and spmc_buffer crates.

If it proves popular, other testing and benchmarking tools may be added, based on user demand.

§Examples

For examples of this crate at work, look at its “tests” and “benchs” submodules, which showcase expected usage.

Modules§

noinline
Inlining barriers for function calls
race_cell
Shareable mutable containers easing detection of race conditions in thread synchronization testing code.

Functions§

concurrent_test_2
Test that running two operations concurrently works
concurrent_test_3
Test that running three operations concurrently works
run_under_contention
Perform some operation while another is running in a loop in another thread