Hello, I need again some monks advise on which road I should walk to modify my code and perform a parallel operation. The code below is part of a small Tk UI. In this portion of the code, the program downloads information from the Web (using LWP::UserAgent and other modules). The results are stored in arrays which are used (they get merged) AFTER all data has been collected. Now the script works serially, which is fine. However, I would like - if possible - to perform the download in parallel so that I can save time while downloading.

#parallel should START here if ($UseDataOne eq 1){ @DataOne=GetDataOne(@TableParameters); } if ($UseDatatwo eq 1){ @Datatwo=GetDatatwo(@TableParameters); } if ($UseDataThree eq 1){ @DataThree=GetDataThree(@TableParameters); } if ($UseDataFour eq 1){ @DataFour=GetDataFour(@TableParameters); } #program should wait here till all 4 arrays are ready

I am totally new to parallel processing, I have tried to integrate subs::parallel but without success (no matter what I try I get always Too many arguments for subs::parallel::parallelize (this is surely due to my inexperience in integrating the module with the rest of the code). I have also read that with Tk parallel processing is not easy, so better ask for your opinion. Do you know any working examples that could help me better understand how to proceed (and that can be possibly used with Tk) ?


In reply to Parallel download Tk by Takamoto

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.