Takamoto has asked for the wisdom of the Perl Monks concerning the following question:
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) ?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Parallel download Tk
by tybalt89 (Monsignor) on Dec 30, 2018 at 22:19 UTC | |
Re: Parallel download Tk
by bliako (Monsignor) on Dec 31, 2018 at 10:04 UTC | |
by Takamoto (Monk) on Dec 31, 2018 at 11:00 UTC | |
by tybalt89 (Monsignor) on Dec 31, 2018 at 13:45 UTC | |
by bliako (Monsignor) on Dec 31, 2018 at 11:27 UTC | |
Re: Parallel download Tk ( threads Thread::Queue LWP::UserAgent WWW::Mechanize)
by Anonymous Monk on Jan 01, 2019 at 09:09 UTC | |
Re: Parallel download Tk
by Anonymous Monk on Dec 31, 2018 at 08:40 UTC | |
by karlgoethebier (Abbot) on Dec 31, 2018 at 10:11 UTC | |
by choroba (Cardinal) on Dec 31, 2018 at 21:14 UTC | |
by Takamoto (Monk) on Dec 31, 2018 at 09:20 UTC | |
by Anonymous Monk on Dec 31, 2018 at 23:44 UTC |