Skip to content
Discussion options

You must be logged in to vote

I cannot readily pinpoint this in the linked code, but the most common source of deadlocks in PyO3-based extension is the GIL which is automatically held when calling into #[pymethod]. Could you try wrapping your whole method body using Python::allow_threads, e.g.

fn process(&mut self, py: Python) -> Result<(), MetaAlmanacError> {
  py.allow_threads(|| { /* same code as before */ })
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ChristopherRabotin
Comment options

Answer selected by ChristopherRabotin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants