New submission from Antoine Pitrou:

On Windows, Lock.acquire() (and other synchronization primitives derived from 
it, such as queue.Queue) cannot be interrupted with Ctrl-C, which makes it 
difficult to interrupt a process waiting on such a primitive.

Judging by the code in Python/_thread_nt.h, it should be relatively easy to add 
such support for the "legacy" semaphore-based implementation (by using 
WaitForMultipleObjects instead of WaitForSingleObject), but it would be much 
hairier for the new condition variable-based implementation.

Of course, many other library calls are prone to this limitation (not being 
interruptible with Ctrl-C on Windows).

See https://github.com/dask/dask/pull/2144#issuecomment-290556996 for original 
report.

----------
components: Library (Lib), Windows
messages: 291072
nosy: kristjan.jonsson, paul.moore, pitrou, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Lock.acquire() not interruptible on Windows
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29971>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to