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.

Thoughts?

Thanks!


In reply to Gtk2 app -- what's better, threads, or multiple timeouts? by ttlgreen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.