async-compat icon indicating copy to clipboard operation
async-compat copied to clipboard

Configurable num threads for tokio runtime?

Open awaited-hare opened this issue 4 years ago • 1 comments

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.

awaited-hare avatar May 21 '20 03:05 awaited-hare

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!

ghost avatar Sep 05 '20 14:09 ghost