Skip to content
Discussion options

You must be logged in to vote

Does the fact that this happens from Rust threads all running Python::with_gil(...) hamper parallelism?

No, same as with_gil, allow_threads is just a safe Rust API around the same PyEval_Save/RestoreThread API backing Py_BEGIN_ALLOW_THREADS. I used allow_threads to keep the example short, but it does not matter whether Python or Rust or C code release the GIL inside with_gil (because that also just wraps the C API).

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@adamreichold
Comment options

@dtheodor
Comment options

@dtheodor
Comment options

@adamreichold
Comment options

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