Beefy Boxes and Bandwidth Generously Provided by pair Networks
Joe Don't ask to ask, just ask  Re^3: Gtk2 app -- what's better,
threads, or multiple timeouts?  by traveler (Parson) on Feb 06,
2009 at 16:40 UTC ( #741950=note: print w/ replies, xml ) Need
Help??  in reply to Re^2: Gtk2 app -- what's better, threads, or
multiple timeouts? in thread Gtk2 app -- what's better, threads,
or multiple timeouts?  If you are experiencing lag, then either
1) run the main loop occasionally during cpu-intensive functions
Okay I'm not sure I understand this. I was under the impression
that the main loop was always running. Does this mean that when
I run a timeout, the main loop "waits" for whatever the timeout
does to finish before it continues on? Observing my program it
does seem like that is the case.  The main loop waits for
events. When it gets one it processes it. If the event it is
processing is a timer event tied to a sub of yours, it runs the
sub. (Don't) try this  while (1) { ... } It will hang the GUI.
So in an