[Edu-sig] Simple example involving threads and infinite loops.
kirby urner
kirby.urner at gmail.com
Wed Jul 18 01:52:35 CEST 2007
> > I reinforce how the "while True" construct, with no opportunities
> > for breaking out, might be an OK construct where *generators*
> > are concerned.
>
> Or web servers! ;-)
>
Yeah, very true. Daemons of all kinds are like infinite loops, connected
to Windows TSRs and services in this article:
http://en.wikipedia.org/wiki/Daemon_(computer_software)
> (Then again, it's always useful to think of having the possibility of
> ending a program gracefully, rather than having to use the power off
> button...)
>
> André
What's cool about a generator is it stops execution at the yield, so
there's no penalty for not writing exit code.
A generator gets garbage collected just like any other object, without
needing to be explicitly halted or paused.
Kirby
More information about the Edu-sig
mailing list