Message380927
> 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:13 | eryksun | set | recipients:
+ eryksun, gvanrossum, paul.moore, vstinner, tim.golden, Mark.Shannon, zach.ware, serhiy.storchaka, steve.dower, miss-islington |
2020-11-13 19:16:12 | eryksun | set | messageid: <1605294972.98.0.376888217888.issue42296@roundup.psfhosted.org> |
2020-11-13 19:16:12 | eryksun | link | issue42296 messages |
2020-11-13 19:16:12 | eryksun | create | |
|