'Fork'ing is probably the right architecture when using IPC, but there are efficient poor man alternatives exploiting the separate R process and unix infrastructure:

1) Dump your arrays into files (probably CSV) into a directory shared e. g. via NFS or sftp.

2) SSH / telnet to the computing boxes (via 'expect' or equivalent perl modules) to start work packages:

 "R commandfile <infile >outfile && rename outfile outfile.done

3) Depending on low memory requirements you could start all R processes at once. If it is just 'nice'ed CPU load I would not care.

4) When memory requirements would cause swapping, you could use the unix 'batch' command to queue work packages.

5) If the work packages include the latex table setting, you could have that 'mail'ed to you.

6) Alternatively a second script checks the NFS share and processes finished R output.

Don't spend too much effort reinventing infrastructure!


In reply to Re: Using threads to run multiple external processes at the same time by NiJo
in thread Using threads to run multiple external processes at the same time by Anonymous Monk

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.