[PEAK] issues with Trellis event loops and threads

Phillip J. Eby pje at telecommunity.com
Wed Jul 23 14:13:22 EDT 2008

At 07:29 PM 7/23/2008 +0300, Sergey Schetinin wrote:
>Thanks for your help, I really appreciate it.
> >> Also, I think I found a bug with the basic EventLoop implementation --
> >> the main loop never exits if there were any events scheduled,
> >
> > That is correct and intended behavior.  You are meant to explicitly
> > terminate event loops; it's an extra feature of the basic EventLoop that it
> > automatically exits when nothing is queued or scheduled.
>That's unexpected. Given that EventLoops are not supposed to be used
>in multithreaded context an infinite loop doing nothing looked odd.

Virtually all event loop implementations run until explicitly 
stopped.  PEAK's event loops are actually quite unusual in that they 
are capable of stopping automatically if there are no future events 
and no pending callbacks.

Compare with wx, Twisted, asyncore, the stdlib socket server classes, 
almost any GUI event loop, etc.

More information about the PEAK mailing list