Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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.



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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2022-01-19 21:06 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (56 votes). Check out past polls.