The fact that the answer to your initial question is, "Because it's easier the way I'm doing it now" tells me that I'm putting too much effort into squeezing a tiny speed increase out of this system :)

Parallel::ForkManager is really good at controlling the maximum number of forked children, when you're trying to fork multiple children to solve parts of a large problem in parallel. Unfortunately, my particular problem has a Lot of medium-sized parts, instead of a few large parts (They each wait for network responses, but none do much in the way of calculation; I'd rather be waiting for 10 network results at a time instead of each one sequentially).

Actually, now that I think of it, I could easily break my list of 10000 medium-sized problems into 10 lists of 1000 problems each, and feed each one to a child. This would be much more efficient than forking 10000 children, 10 at a time, each solving only one problem. And it would also be quite easy :)

Thank you for your suggestion!

Alan


In reply to Re: Re: Those fork()ing flock()ers... by ferrency
in thread Those fork()ing flock()ers... by ferrency

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.