Hello fellow Monks!

So, I'm having this problem when working with threading. I'm hoping someone can help me resolve it. So, what I have is a GUI written in Visual Perl .NET that based on some user input runs a particular set of operations. These operations take a large chunk of time to complete, and they appear to be causing my GUI to freeze.

So, what I was thinking I would do is make a seperate thread for the actions that take place, hoping that this would keep the GUI from freezing. The problem here is, the actions need to communicate their results back to the GUI. Unfortunately, when I try to output to the GUI, it will not allow me to. It simply doesn't show anything, there's no errors, it just doesn't show anything.

I've tried several different threading methods, including those from .NET, as well as perl's threads. Basically I'm creating a thread that is associated with a function (or subroutine), and I'm hoping that when I click go on my GUI, that control will be passed to the thread, or the function (which it is), but I still need that thread to be able to communicate its results to the GUI.

Is there a better way to do this? What am I missing? Sorry, I'm a bit clueless when it comes to threads.


In reply to Threading in Perl by SyN/AcK

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.