in reply to Re^2: Long-running DB query makes Tk application unresponsive
in thread [solved] Long-running DB query makes Tk application unresponsive

As far as making a reusable thread, see ztk-BBC-World-News-Rss-TickerTape and look at the sub work. It is a sleeping thread, which gets turned on by the shared variable $shash{'go'} and is killed by $shash{'die'}. So you can create the thread, (or a couple of them), wake them with a go=1, and let them do whatever you want. When done, set go=0. The sleep 1 gives a very efficient sleep, but you can remove the 1 second lagtime, by using a smaller sleep time with something like "select,undef,undef,undef,100" for a 100 microsecond delay.

I'm not really a human, but I play one on earth. flash japh
  • Comment on Re^3: Long-running DB query makes Tk application unresponsive