Registry / testing / loom
library0.7.2rscratesunverified

Permutation testing for concurrent code

# Cargo.toml [dependencies] loom = "0.7.2"
INSTALL
IMPORT
SIG · LOOM
L
loom
testingrustv0.7.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Arc
use loom::sync::Arc;

Tests concurrent code under all possible thread interleavings.

use loom::sync::Arc; use loom::thread; loom::model(|| { let arc = Arc::new(0); let arc2 = arc.clone(); thread::spawn(move || { *arc2.lock().unwrap() += 1; }); *arc.lock().unwrap() += 1; });
Debug
Known issues
gotchaOnly for testing; not for production use. Replaces std concurrency primitives.
fix
Use loom::sync instead of std::sync in test code.
affects: >=0.1.0
Upgrade
Version history
0.7.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
loom — cargo add loom · libregistry