STINNER Victor added the comment:

Supporting to release the GIL would require to redesign the _sre module.

For example, the getstring() gets a "view" of a Python string, it doesn't copy 
the string. So we must hold the GIL, otherwise the Python string can be 
modified by other threads. Copying a very long string may be slower than just 
match the pattern :-/

During the pattern matching, other Python functions are called, these functions 
require the GIL to be hold. Example: PyObject_Malloc().

----------
nosy: +haypo
type: resource usage -> performance

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23690>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to