[Python-ideas] Async API

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Oct 25 03:34:59 CEST 2012


On 25/10/12 12:43, Guido van Rossum wrote:
> Note that in a world with only blocking calls this *can* be a problem...
 > a common approach to giving operations a timeout is sending it a SIGTERM

Well, yes, if you have preemptive interruptions of some kind, then
things are a lot trickier. But I'm assuming we're using cooperative
scheduling *instead* of things like that.

(Note that in the face of preemption, I don't think it's possible
to solve this problem completely without language support, because
there will always be a small window of opportunity between
entering the finally clause and getting into the with-statement
or whatever that you're using to block asynchronous signals.)

-- 
Greg



More information about the Python-ideas mailing list