Skip to content
Advertisement

Tag: python-cffi

Does calling a c function via ctypes in python release the GIL during execution of the C code

I want to call some c function from python to be able to improve performance of my code. But I cannot find online whether when I call a C function using the ctypes libraries the GIL is released. As a simple example: Is the GIL released during the call to fun.sleep? Answer According to [Python.Docs]: ctypes.CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) (emphasis

Advertisement