Skip to content

Does pymethods cause a deadlock when used with multi-thread? #4367

Answered by mejrs
Yosh31207 asked this question in Questions
Discussion options

You must be logged in to vote

This sounds like a variant of https://pyo3.rs/v0.22.2/faq#im-experiencing-deadlocks-using-pyo3-with-lazy_static-or-once_cell

But yes, the GIL is just another Mutex. You should always release one before locking the other.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Yosh31207
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants