Re:No-GIL mode coming for Python
by samus on Saturday July 29, 2023 @06:55AM
(#36918936)
C extensions are a different use case than accessing a C library using `ctypes`. The former allows intimate interactions with Python objects and therefore requires the GIL. The latter should only cause trouble if the C library executes callbacks on another thread. In that case, a Python thread is created for every invocation, which could cause race conditions with Python code. However, this problem also exists in GIL mode. In most cases, foreign libraries usually have Pythonic wrappers that should prevent some of these issues.
[ Parent
| on HN ]
There are no comments on this comment yet.