in reply to threading a perl script

"Don't diddle code to make it faster .. choose a better algorithm." -- The Elements of Programming Style

Replies are listed 'Best First'.
Re^2: threading a perl script
by BrowserUk (Patriarch) on Apr 25, 2011 at 15:40 UTC

    And if you're already using the best algorithm available and it is still too slow?

      Thank you all for the kind replies, i'll not include threading in my script after each time i read in a line. However, i'll try to thread multiple files, since i have multiple large files all to be processed the same way. I think i can thread these together, am i right?

      Next question; how can I thread for example 3 files and then wait till one is finished and then the next file can be processed. In other words; how can i process, for example, always 3 files at the same time?

      Kind regards, Boetsie
        In other words; how can i process, for example, always 3 files at the same time?

        It depends. You simple are not giving enough of a description of what you are doing to the files, and what you hope to gain by the use of threading, for anyone to be able to hazard a guess as to how it might be best done.

        If you posted a sample of the contents of these files; along with a tally of how many and how big these files are and how long it takes to process them and most importantly, the code you are using to process them; you might get some useful answers.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.