in reply to How to break up a long running process

Ultimately the answer, in some form or another, is threads. The tutorials section contains Threads: why locking is required when using shared variables and Things you need to know before programming Perl ithreads, neither of which is a tutorial that introduces the concepts you require, nor paints in the big yellow and black warning borders around the tricky areas. The Perl documentation contains perlthrtut, which may be a good start. Another way to go about things (by hiding the tread stuff under the hood somewhat) is to use POE.

Beware, threads can be tricky creatures that bite in nasty and unusual ways. On the other hand, there are a few Perl Monks around with a fair amount of experience taming them so pleas for help will certinally be answered. Good luck ;).


DWIM is Perl's answer to Gödel
  • Comment on Re: How to break up a long running process

Replies are listed 'Best First'.
Re^2: How to break up a long running process
by BrowserUk (Patriarch) on Oct 25, 2006 at 08:19 UTC

    perlthrtut is almost completely useless as a starting point on how to use iThreads.

    Things you need to know before programming Perl ithreads (which I refuse to link), describes a situation circa. v5.8.0 (the first ever iThreads build) & v5.8.1 (the buggiest threaded perl build ever, that lasted a whole 41 days before being superceded), from the perspective of someone who attempted to emulate iThreads with forks--and failed. Update: Are you going to refer newbies to Things you should need to know before using Perl regexes. (Humour, with a serious point) when they ask about regexes?

    And, in the process succeeded in littering the entire cpan Thread::* and (as I recently discovered) thread::* namespaces with over-ambitious, unsupported (and almost unsupportable), mostly defunct, and do nothing modules that are in great part the cause of the difficulties that people have trying to use iThreads, (Now sadly billed as the "greatest authority on Perl threading"!).

    Finally, how about you try writing a POE solution before you recommend it to others on the basis of hearsay.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.