Hello monks!

Earlier this summer, I wrote a script to prepare large data files for some bioinformatics analysis. Since the number of options and input files to be specified by the user grew with the project, I decided to make a GUI using Tk. The GUI allows the user to specify the different input files and options, and then to launch the computation that the script was meant to do in the first place.

The problem is that, when the computation is launched, the interface freezes in the most inelegant way. And any progress message sent to the GUI is not shown until the computation is over (that makes for very useless progress messages!).

I've read that this freezing of the GUI is a common problem and the solution that is often proposed is to use parallel programming. I tried it briefly by replacing

&Launch_computation();

by

my $t1 = Thread -> new(\&Launch_computation()); $t1 -> detach();

On the surface, the problem was solved (the GUI was not jammed and progress messages were delivered timely). But I also faced new error messages that contains no reference to my code, like

Attempt to free non-existent shared string '_TK_RESULT_', Perl interpreter: 0x207ab410 at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Tk.pm line 250.

I am aware of the dangers and problems of parallel programming and I don't feel that I know perl well enough to do it... especially to do it well and safely. So I was wondering if you monks know of a way to free the Tk MainLoop without getting into parallel programming.

Thank you very much for your help!

In reply to Is there a way to free the Tk MainLoop without getting into parallel programming? by Takuan Soho

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.