From 234f52135a75375653a3d020c7eeb71c2cd52f81 Mon Sep 17 00:00:00 2001 From: ihciah Date: Mon, 4 Nov 2024 08:46:14 +0000 Subject: [PATCH] attach thread pool for legacy runtime --- monolake/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monolake/src/main.rs b/monolake/src/main.rs index 970ce66..db334a5 100644 --- a/monolake/src/main.rs +++ b/monolake/src/main.rs @@ -61,6 +61,8 @@ fn main() -> Result<()> { monolake_core::config::RuntimeType::Legacy => { monoio::RuntimeBuilder::::new() .enable_timer() + // Since we read file, we need a thread pool to avoid blocking the runtime + .attach_thread_pool(Box::new(monoio::blocking::DefaultThreadPool::new(4))) .build() .expect("Failed building the Runtime with LegacyDriver") .block_on(run(runtime_config, &args.config));