dscale 0.4.0

A fast & deterministic simulation framework for testing and benchmarking distributed systems
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Represents how many threads will workers use to run steps in parallel.
pub enum Threads {
    /// Thread number that will match number of cores on your machine.
    All,
    /// Specific number of threads.
    Specific(usize),
}

impl Into<usize> for Threads {
    fn into(self) -> usize {
        match self {
            Threads::All => std::thread::available_parallelism()
                .expect("could not acquire machine core number")
                .get(),
            Threads::Specific(number) => number,
        }
    }
}