|No such thing as a small change|
Gtk2 app -- what's better, threads, or multiple timeouts?by ttlgreen (Sexton)
|on Feb 05, 2009 at 22:22 UTC||Need Help??|
ttlgreen has asked for the wisdom of the Perl Monks concerning the following question:
Hello again perl masters!
I hope I'm not annoying you all with all my newbie questions!
I'm wondering what the best method is for running multiple simultaneus background functions while having a gtk gui to control them would be.
So far I've been using timeouts (because I was having issues with a module I wrote that used threads causing Gtk to spit out very non-helpful errors) and I've noticed the gui seems to lag while the timeout functions are running.
Would threads be a better solution? Might I be failing to do something properly in regards to the timeouts that could be causing this? I've basically been learning how to do this by reading the Gtk2 pods and lots of trial and error. That being said it's very possible the way I'm going about doing this is pretty nasty.
I'd post the code but I don't think any of you would be willing to read something THAT long ;-) and this is more of a programming theory question than a bug hunting problem anyway.
My guess is threads would probably be the better option and I should just use timeouts when necessary to start up the threads that do the actual work.