andygrove commented on code in PR #828:
URL: https://github.com/apache/datafusion-comet/pull/828#discussion_r1717146193


##########
native/core/src/execution/jni_api.rs:
##########
@@ -133,8 +133,21 @@ pub unsafe extern "system" fn 
Java_org_apache_comet_Native_createPlan(
         let debug_native = parse_bool(&configs, "debug_native")?;
         let explain_native = parse_bool(&configs, "explain_native")?;
 
+        let worker_threads = configs
+            .get("worker_threads")
+            .map(String::as_str)
+            .unwrap_or("4")
+            .parse::<usize>()?;
+        let blocking_threads = configs
+            .get("blocking_threads")
+            .map(String::as_str)
+            .unwrap_or("10")
+            .parse::<usize>()?;
+
         // Use multi-threaded tokio runtime to prevent blocking spawned tasks 
if any
         let runtime = tokio::runtime::Builder::new_multi_thread()
+            .worker_threads(worker_threads)
+            .max_blocking_threads(blocking_threads)

Review Comment:
   For reference, we were previously using these defaults:
   
   ```
               // Read from environment variable first in multi-threaded mode.
               // Default to lazy auto-detection (one thread per CPU core)
               worker_threads: None,
   
               max_blocking_threads: 512,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to