Just as a follow-on to zentara's excellent suggestion, I would mention that $mw->repeat(10, ...) shouldn't, I feel, be considered a bad idea. I mean, yes it's "wasteful" in the sense that there is an overhead imposed for the large majority of the time when it doesn't find anything in the queue, but at the same time, threads impose a rather substantial overhead penalty as well because they force Perl to implement preemptive multitasking within a single process, which is no mean feat.
I don't have hard numbers, but I can support this anecdotally by observing that I tried implementing something sort of like this where I needed an LWP GET request to update a Tk progress bar. I got a much smoother result by having the :content_cb subroutine from my LWP::UserAgent call $mw->update directly than by having LWP and the Tk MainLoop running in separate threads.
In reply to Re: Tk and Threads (again)
by Errto
in thread Tk and Threads (again)
by Ace128
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |