Re: [Python-Dev] Interrupt thread.join() with Ctrl-C / KeyboardInterrupt on Windows

2017-08-09 Thread Antoine Pitrou
On Tue, 8 Aug 2017 14:29:41 -0700 Steve Dower wrote: > On 08Aug2017 1151, Nathaniel Smith wrote: > > It looks like Thread.join ultimately ends up blocking in > > Python/thread_nt.h:EnterNonRecursiveMutex, which has a maze of #ifdefs > > behind it -- I think there are 3

Re: [Python-Dev] Interrupt thread.join() with Ctrl-C / KeyboardInterrupt on Windows

2017-08-08 Thread Steve Dower
On 08Aug2017 1512, Nathaniel Smith wrote: On Tue, Aug 8, 2017 at 2:29 PM, Steve Dower wrote: On 08Aug2017 1151, Nathaniel Smith wrote: It looks like Thread.join ultimately ends up blocking in Python/thread_nt.h:EnterNonRecursiveMutex, which has a maze of #ifdefs

Re: [Python-Dev] Interrupt thread.join() with Ctrl-C / KeyboardInterrupt on Windows

2017-08-08 Thread Nathaniel Smith
On Tue, Aug 8, 2017 at 2:29 PM, Steve Dower wrote: > On 08Aug2017 1151, Nathaniel Smith wrote: >> >> It looks like Thread.join ultimately ends up blocking in >> Python/thread_nt.h:EnterNonRecursiveMutex, which has a maze of #ifdefs >> behind it -- I think there are 3

Re: [Python-Dev] Interrupt thread.join() with Ctrl-C / KeyboardInterrupt on Windows

2017-08-08 Thread Steve Dower
On 08Aug2017 1151, Nathaniel Smith wrote: It looks like Thread.join ultimately ends up blocking in Python/thread_nt.h:EnterNonRecursiveMutex, which has a maze of #ifdefs behind it -- I think there are 3 different implementation you might end up with, depending on how CPython was built? Two of

Re: [Python-Dev] Interrupt thread.join() with Ctrl-C / KeyboardInterrupt on Windows

2017-08-08 Thread Jonathan Slenders
Thank you Nathaniel for the response! Really interesting and helpful. 2017-08-08 20:51 GMT+02:00 Nathaniel Smith : > On Tue, Aug 8, 2017 at 2:54 AM, Jonathan Slenders > wrote: > > Hi all, > > > > Is it possible that thread.join() cannot be interrupted on

Re: [Python-Dev] Interrupt thread.join() with Ctrl-C / KeyboardInterrupt on Windows

2017-08-08 Thread Nathaniel Smith
On Tue, Aug 8, 2017 at 2:54 AM, Jonathan Slenders wrote: > Hi all, > > Is it possible that thread.join() cannot be interrupted on Windows, while it > can be on Linux? > Would this be a bug, or is it by design? > > > import threading, time > def wait(): > time.sleep(1000)

[Python-Dev] Interrupt thread.join() with Ctrl-C / KeyboardInterrupt on Windows

2017-08-08 Thread Jonathan Slenders
Hi all, Is it possible that thread.join() cannot be interrupted on Windows, while it can be on Linux? Would this be a bug, or is it by design? import threading, time def wait(): time.sleep(1000) t = threading.Thread(target=wait) t.start() t.join() # Press Control-C now. It stops on Linux,