3 ms·
Use tokio (async) when you wait a lot, use rayon (threads) when you compute a lot. These are two almost orthogonal concurrency use-cases.
by lr1970 4y ago
Use tokio (async) when you wait a lot, use rayon (threads) when you compute a lot. These are two almost orthogonal concurrency use-cases.
- vlovich123 4y agoDoes rayon offer the ability to pick which CPUs are available for distributing work to? I want to pick N cores for I/O and the rest to do compute but I didn’t see a way to let me pin the CPUs rayon could use for its compute threads.
- lr1970 4y agoRayon operates on top of the thread pool. You can control its size [0] and limit it to a fraction of your available cores leaving the rest for I/O. [0] https://docs.rs/rayon/latest/rayon/struct.ThreadPoolBuilder.html#method.num_threads https://docs.rs/rayon/latest/rayon/struct.ThreadPoolBuilder....