Expand description
Interaction with Python’s global interpreter lock
Structs§
- GILGuard 🔒RAII type that represents the Global Interpreter Lock acquisition.
- GILPoolDeprecatedA RAII pool which PyO3 uses to store owned Python references.
- LockGIL 🔒Used to lock safe access to the GIL
- Thread-safe storage for objects which were inc_ref / dec_ref while the GIL was not held.
- A guard which can be used to temporarily release the GIL and restore on
Drop
.
Constants§
- This is an internal counter in pyo3 monitoring whether this thread has the GIL.
- Temporarily hold objects that will be released when the GILPool drops.
Statics§
Functions§
- Decrements pyo3’s internal GIL count - to be called whenever GILPool or GILGuard is dropped.
- Checks whether the GIL is acquired.
- Increments pyo3’s internal GIL count - to be called whenever GILPool or GILGuard is created.
- prepare_freethreaded_pythonNeither
PyPy
norGraalPy
Prepares the use of Python in a free-threaded context. - Registers a Python object pointer inside the release pool, to have its reference count decreased the next time the GIL is acquired in pyo3.
- Registers a Python object pointer inside the release pool, to have its reference count increased the next time the GIL is acquired in pyo3.
- Registers an owned object inside the GILPool, to be released when the GILPool drops.
- with_embedded_python_interpreter⚠Neither
PyPy
norGraalPy
Executes the provided closure with an embedded Python interpreter.
Type Aliases§
- PyObjVec 🔒