This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sbt
Recipients brian.curtin, jnoller, pitrou, sbt, tim.golden
Date 2011-06-16.14:34:21
SpamBayes Score 3.275158e-15
Marked as misclassified No
Message-id <1308234862.44.0.262405628185.issue12328@psf.upfronthosting.co.za>
In-reply-to
Content
> Hmm, it seems to me that it should be done in _poll() instead. 
> Otherwise, recv() will not be interruptible, will it?

Or maybe WaitForMultipleObjects() should be changed to also wait on sigint_event if called by the main thread.

> Also, after looking at this again, it seems sigint_event would be 
> better provided (at the C level) by the Python core, e.g. as 
> _PyOS_SigintEvent. The time module already uses a similar mechanism.

> By setting the event in the sigint handler itself, rather than in an 
> auxiliary HandlerRoutine callback function, it should also ensure 
> that, when the event is set, the "tripped" bit in signalmodule.c 
> has been set, meaning we wouldn't need to Sleep() anymore.

> (I also wonder why the event isn't auto-reset. Otherwise, there's a 
> race condition - which is probably harmless in most cases, but still.)

If it is an auto-reset event then we must worry about a non-main thread stealing the event.  Maybe _PyOS_SigintEvent() should return NULL if called by a non-main thread, and be documented with a loud usage warning.
History
Date User Action Args
2011-06-16 14:34:22sbtsetrecipients: + sbt, pitrou, tim.golden, jnoller, brian.curtin
2011-06-16 14:34:22sbtsetmessageid: <1308234862.44.0.262405628185.issue12328@psf.upfronthosting.co.za>
2011-06-16 14:34:21sbtlinkissue12328 messages
2011-06-16 14:34:21sbtcreate