I want to do a bit of distributed computing. This is new to me and so I am not familiar with the language that is used to describe it. Anyway, my idea is as follows:

A maximum of 4 computers are running this Perl program, if they are all on.
I want the following steps to be performed:


A. Background monitoring for incoming user request files.

B. Detection of an incoming request file to a network drive.

C. Determination of which of 4 computers are available to handle the allocation of the request. If the more senior computers of the 4 are running then the following request handling is left to the most senior. If the senior PCs do not respond then the junior PCs respond in time. Subordinate PCs return to stage A.
D. The contents of 4 folders (on a network drive) are read (each folder corresponds to one of the 4 PCs).

E. Measurement of the sum of file sizes for all files ending with ‘.txt ‘, for each of these folders, is made.

F. ‘Request txt file’ is copied into the folder with the least sum of file sizes.

G. If all the folders are at the same status I want to briefly assess CPU activity for all the PCs that are on (if this number is >2) and allocate the file to the corresponding folder for which the least CPU activity is measured. I only want this measurement to be made once for each request file.

H. If the file is not removed from this folder after 5 seconds I want to copy the file to the folder with the second least sum of file sizes for .txt files, until all the folders have been tried. This cyclic moving of files then continues but at 10 second intervals and then 15 second intervals and so on. If a PC was found not to be on at stage C then they are omitted from the cycle. Once the wait reaches 1 minute I want the allocating PC to handle the request itself.


Other programs are already in place that will process the request file and run with it. I have code that will handle stages A, B, D, F. Can anyone please suggest code, modules, pitfalls or previous examples to follow for these other stages? Also, please suggest improvements to the way that I describe the process that I want.

In reply to distributed computing by Win

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.