diff --git a/runtime/tokio_util.rs b/runtime/tokio_util.rs index 0d81f6e235..aa0282ece8 100644 --- a/runtime/tokio_util.rs +++ b/runtime/tokio_util.rs @@ -43,7 +43,15 @@ pub fn create_basic_runtime() -> tokio::runtime::Runtime { // parallel for deno fmt. // The default value is 512, which is an unhelpfully large thread pool. We // don't ever want to have more than a couple dozen threads. - .max_blocking_threads(32) + .max_blocking_threads(if cfg!(windows) { + // on windows, tokio uses blocking tasks for child process IO, make sure + // we have enough available threads for other tasks to run + 4 * std::thread::available_parallelism() + .map(|n| n.get()) + .unwrap_or(8) + } else { + 32 + }) .build() .unwrap() }