async-compat
async-compat copied to clipboard
Configurable num threads for tokio runtime?
https://github.com/stjepang/smol/blob/3e899311b08fa01693e83560384e6cb8850e5573/src/context.rs seems to use num_cpu
threads by default. It will probably be better if we can control the number of threads used (especially necessary when we want to run a program on a machine with more than a few dozen cores).
Similar issue in async-std: https://github.com/async-rs/async-std/pull/774, https://github.com/async-rs/async-std/pull/690.
I remember Tokio already has configurations like core_threads
and max_threads
, but currently there's no way to configure them in smol.
This issue now belongs into async-compat
, where the default number of threads is set to 1.
I'm not sure yet how to make the number of threads configurable... ideas welcome!