STINNER Victor added the comment:

> Is it possible to backport this patch to 2.7?

No.

Python 2.7 supports many implementations of threads:

$ ls Python/thread_*h -1
Python/thread_atheos.h
Python/thread_beos.h
Python/thread_cthread.h
Python/thread_foobar.h
Python/thread_lwp.h
Python/thread_nt.h
Python/thread_os2.h
Python/thread_pth.h
Python/thread_pthread.h
Python/thread_sgi.h
Python/thread_solaris.h
Python/thread_wince.h

Supporting signals on all implementations would be a huge work.

Handling correctly signals is also a complex task. For example, the PEP 475 
changed how Python 3.5 handles signals (retry interrupted syscall), the change 
is larger than just the threading module. This PEP has an impact on the whole 
CPython code base (C and Python).

In Python, unit tests are important. The change b750c45a772c added many unit 
tests, I expect that it will be tricky to make them reliable on all platforms 
supported by Python 2.7. I dislike the idea of backporting the feature just for 
a few platforms.

I mean that the change b750c45a772c alone is not enough, this change depends on 
many earlier changes used to cleanup/prepare the code to support this change. 
It is also followed by many changes to enhance how Python handles signals. It 
took multiple years to fix all subtle issues, race conditions, etc.

There is also a significant risk of breaking applications relying on the 
current behaviour of Python 2.7 (locks are not interrupted by signals).

----------

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

Reply via email to