[issue38428] Can't gracefully ctrl+C multiprocessing pool on Python3 & Windows

2021-03-21 Thread Eryk Sun
Eryk Sun added the comment: In bpo-29971 it was suggested to split the PyThread lock API in Windows into an "interruptible lock" API that's based on emulated condition variables and a "fast lock" API that's based on native condition variables and SRW locks. Maybe the only API change that's

[issue38428] Can't gracefully ctrl+C multiprocessing pool on Python3 & Windows

2019-10-10 Thread Eryk Sun
Eryk Sun added the comment: > Python 2.7 had totally different code, IIRC. In 2.7 the wait() method of threading._Condition implements the timeout with a loop the calls time.sleep() with an increasing delay from 500 microseconds up to 50 ms, and no more than the remaining time. > But the

[issue38428] Can't gracefully ctrl+C multiprocessing pool on Python3 & Windows

2019-10-10 Thread Steve Dower
Steve Dower added the comment: I think you're right about that change touching the right code, but I'm pretty sure it wasn't working before either. (Python 2.7 had totally different code, IIRC.) But the good news is that we should be able to use code similar to what's in

[issue38428] Can't gracefully ctrl+C multiprocessing pool on Python3 & Windows

2019-10-10 Thread Rebecca Fair
Rebecca Fair added the comment: Sorry, I didn't realise it wouldn't link to a commit automatically, the commit is here: https://github.com/python/cpython/commit/7c3e5773954009d65520eb063621cf7724da88e3 -- ___ Python tracker

[issue38428] Can't gracefully ctrl+C multiprocessing pool on Python3 & Windows

2019-10-10 Thread Rebecca Fair
New submission from Rebecca Fair : I want to be able to Ctrl+C to exit a multiprocessing Pool.map gracefully, and have made a solution based on this Stack Overflow answer: https://stackoverflow.com/questions/11312525/catch-ctrlc-sigint-and-exit-multiprocesses-gracefully-in-python However,