Brian Curtin <br...@python.org> added the comment:

Attaching an initial patch implementing the same functionality but using 
WaitForMultipleObjects. Here's some details:

WFMO takes an array of objects to wait on, which is the pipe handle and 
sigint_event which is a handle to an event which gets set when CTRL-C is caught 
(see Modules/_multiprocessing/multiprocessing.c). Waiting for both objects 
replaces the need to write a custom loop which periodically calls 
PyErr_CheckSignals.

A negative timeout was effectively a blocking call, so we can let WFMO handle 
that with an INFINITE timeout setting.

WFMO returns the object which raised it relative from event 0, so the switch 
case for a CTRL-C is 0+1 and returns the same value as before. If the pipe was 
the object to raise, just like before: return true if there's data, false if 
not.

----------
keywords: +patch
Added file: http://bugs.python.org/file21405/issue11668.diff

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

Reply via email to