[Python-ideas] async: feedback on EventLoop API

Antoine Pitrou solipsis at pitrou.net
Mon Dec 17 23:11:34 CET 2012


On Tue, 18 Dec 2012 11:00:35 +1300
Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Guido van Rossum wrote:
> > (*) Most event loops I've seen use e.g. 30 seconds or 1 hour as
> > infinity, with the idea that if somehow a race condition added
> > something to the ready queue just as we went to sleep, and there's no
> > I/O at all, the system will recover eventually.
> 
> I don't see how such a race condition can occur in a
> cooperative multitasking system. There are no true
> interrupts that can cause something to happen when
> you're not expecting it. So I'd say let infinity
> really mean infinity.

Most event loops out there allow you to schedule callbacks from other
(preemptive, OS-level) threads.

Regards

Antoine.





More information about the Python-ideas mailing list