-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Discussed in PyO3/pyo3#4775
Originally posted by ertosns December 6, 2024
allow_threads doesn't release gil for detached smol::Executor in background, for example the following code block only run in the main thread, and the gil doesn't seem to be released.
async fn executor_run() {
let ex = Arc::new(smol::Executor::new());
let fut = ex.spawn(async {
println!("executor run\n");
});
Python::with_gil(|gil| {
gil.allow_threads(|| {
fut.detach();
})
})
}
Metadata
Metadata
Assignees
Labels
No labels