Dear monks,

I am pretty confused about perl forks...I am pretty new to perl so please be gentle :) ..... i shall define my problem. I need to call three different systems in a cluster all of which together need to execute n number of iterations of a single process individually and have different input data. They need to run simultaneously and without repetitions. ex:

for(i=0;i<n;;) { execute command in system 1 input data is array[i]; execute command in system 2 input data is array[i+1]; execute command in system 3 input data is array[i+2]; i+3; }
P.S. Here if system 2 finishes first then the next data in array should be sent to system 2. and no system should EVER be idle till no input data is remaining.

PLEASE SMS (Save My Soul)

Phew....If any queries or this seems disastrously complicated please let me know..I have been stuck at this point for over two days...and am looking for the monks to shed light for this disheartened soul..:(


In reply to Forking problem UPDATED by avi_learns_perl

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.