7 Jan
2010
7 Jan
'10
2:05 p.m.
MRAB, 07.01.2010 04:07:
I've been wondering whether it's possible to release the GIL in the regex engine during matching.
I know that it needs to have the GIL during memory-management calls, but does it for calls like Py_UNICODE_TOLOWER
Py_UNICODE_TOLOWER looks safe to me at first glance.
or PyErr_SetString?
Certainly not safe.
Is there an easy way to find out?
Release it and fix any crashes? Note that this isn't a safe solution, though, as some GIL requiring code may be platform specific. So a better approach might be to extract any obviously problematic stuff from the existing code (such as any exception handling, explicit ref-counting or object creation), and *then* try to release the GIL. Stefan