Author vstinner
Recipients Yuri.Bochkarev, gregory.p.smith, hobb0001, jyasskin, pitrou, rnk, superbobry, vstinner
Date 2016-09-28.16:13:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475079194.0.0.0788570084745.issue8844@psf.upfronthosting.co.za>
In-reply-to
Content
> 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).
History
Date User Action Args
2016-09-28 16:13:14vstinnersetrecipients: + vstinner, gregory.p.smith, pitrou, jyasskin, rnk, hobb0001, superbobry, Yuri.Bochkarev
2016-09-28 16:13:13vstinnersetmessageid: <1475079194.0.0.0788570084745.issue8844@psf.upfronthosting.co.za>
2016-09-28 16:13:13vstinnerlinkissue8844 messages
2016-09-28 16:13:13vstinnercreate