I need to access a variety of networking equipment and start a debug log on each, then wait for an event on another server, then re-access the networking equipment to stop the debug mode, and finally collect the logs for upload to an FTP site. I am using the threads module but the details of the requirements have reached the point where I feel that some sort of scheduler is required.

I have a precedence list, such as used in a topo sort, to determine which tasks need to wait for which other tasks to complete before they can run. In all but one case, each task needs to wait for all of it's preceding tasks to complete before it can execute, however tasks can and should be executed in parallel when ever possible. Every example that I have found for using the threads module starts all possible tasks at the same time and waits for them all to complete before proceeding. This is not what I need to do, I have a "skein" of tasks to be executed. (The one exception to the wait-for-all rule is that I have two tasks that need to wait for either of them to finish instead of both. One of the tasks is grepping a remote log file looking for a match, the other task is waiting for the remote machine to crash. If either task finishes, the other should be aborted and I can continue with the next step.)

Can anyone point me to a package or code that accomplishes what I need to do? Many thanks.


In reply to A job scheduler for the threads module by samwyse

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.