This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Mark.Shannon, eryksun, gvanrossum, miss-islington, paul.moore, serhiy.storchaka, steve.dower, tim.golden, vstinner, zach.ware
Date 2020-11-13.19:16:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> That sounds like a micro-optimization which is not worth it.

In the back of my mind I was also thinking to generalize the behavior at runtime whenever a signal is tripped by a non-Python thread (e.g. a thread created by an extension module or ctypes), instead of special-casing Windows. 

To examine this, I created a C library in Linux that defines a test() function that creates two threads via pthread_create(). The first thread sleeps for 10 seconds, and the second thread sleeps for 5 seconds and then calls pthread_kill() to send a SIGINT to the first thread. In 3.8, calling the test() function via ctypes followed by executing an infinite loop will interrupt the loop with a KeyboardInterrupt as soon as the second thread sends SIGINT. But in 3.10, the loop never gets interrupted because the C signal handler isn't called on the main thread, so eval_breaker never gets set.
Date User Action Args
2020-11-13 19:16:13eryksunsetrecipients: + eryksun, gvanrossum, paul.moore, vstinner, tim.golden, Mark.Shannon, zach.ware, serhiy.storchaka, steve.dower, miss-islington
2020-11-13 19:16:12eryksunsetmessageid: <>
2020-11-13 19:16:12eryksunlinkissue42296 messages
2020-11-13 19:16:12eryksuncreate