vthread 0.1.0

Bounded carrier-affine virtual threads for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use super::*;
#[test]
fn concurrent_runtime_ids_are_unique() {
    let workers: Vec<_> = (0..8)
        .map(|_| std::thread::spawn(|| (0..100).map(|_| RuntimeId::next()).collect::<Vec<_>>()))
        .collect();
    let ids: std::collections::BTreeSet<_> = workers
        .into_iter()
        .flat_map(|w| w.join().unwrap())
        .collect();
    assert_eq!(ids.len(), 800);
}