Message198681
(replying to Guido's post in another thread)
> Charles-Francois, sorry to add you back to the bug, but (a) I thought you had agreed to a compromise patch that restarts signals in most cases but not for select(), poll() etc.; (b) I may have found a flaw in the idea.
> The flaw (if it is one) is related to Py_AddPendingCall(). This "schedules" a pending callback, mostly for signals, but doesn't AFAICT interrupt the mainthread in any way. (TBH, I only understand the code for Python 2.7, and in that version I'm sure it doesn't.)
>
> So is this a flaw? I'm nor sure. Can you think about it?
I don't think that's a problem: the way I was planning to tackle signals is to call PyErr_CheckSignals() before retrying upon EINTR: this runs signal handlers, and returns a non 0 value if an exception occured (e.g. KeyboardInterrupt): if that's the case, then we simply break out of the loop, and let the exception bubble up.
See e.g. http://hg.python.org/cpython/file/default/Modules/socketmodule.c#l3397 |
|
Date |
User |
Action |
Args |
2013-09-30 07:11:02 | neologix | set | recipients:
+ neologix, gvanrossum, arigo, gregory.p.smith, pitrou, vstinner, giampaolo.rodola, sbt |
2013-09-30 07:11:02 | neologix | set | messageid: <1380525062.61.0.551862251385.issue18885@psf.upfronthosting.co.za> |
2013-09-30 07:11:02 | neologix | link | issue18885 messages |
2013-09-30 07:11:02 | neologix | create | |
|