Could a C extension for multithreaded Python boost performance?
To answer your original question:
Yes, C extensions can be immune from the GIL, provided they do not call any Python API functions without the GIL held. So, if you need to communicate with the Python app, you'd need to acquire the GIL to do so. If you don't want to get your hands too dirty with the C API, you can use ctypes
to call a C library (which can just use pthreads
as usual), or Cython to write your C extension in a Python-like syntax.