Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Useful number of childs revisited

by karlgoethebier (Abbot)
on May 08, 2015 at 17:43 UTC ( [id://1126125]=note: print w/replies, xml ) Need Help??


in reply to Re: Useful number of childs revisited
in thread Useful number of childs revisited [SOLVED]

"...run tests and trials... should be pretty clear where the sweet spot is"

Yes - what else should i do?

But i think that you agree that the phenomenon i described is - to put it mildly (gelinde gesagt?) - surprising unexpected.

Edit: Minor change of wording - i said this already.

Thanks and best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

  • Comment on Re^2: Useful number of childs revisited

Replies are listed 'Best First'.
Re^3: Useful number of childs revisited
by BrowserUk (Patriarch) on May 08, 2015 at 17:51 UTC

    BTW: The simple cure for the problem would be to switch sleep for select( '','','', $timeout ), which would allow the timeout to be specified in fractional seconds; and set the default to something like 0.01. (Without adding a dependency upon Time::HiRes )


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
      "...to switch sleep for select( '','','', $timeout )..."

      Unfortunately i must admit that i don't understand this.

      Best regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

        i don't understand this.

        See the "Blocking calls" section of the P::FM docs.

        By default; the parent process polls to see if one fo the existing kids has completed; and sleeps between polls. And by default, sleeps's smallest granularity is 1 second. Thus, it does not notice when a child process has finished for upto 1 second after it has.

        For processes as in (my version of) your example where the processing takes 0.142s to complete; that means each process that gets waited for takes 85% longer in elapsed time before its replacement gets started.

        If the module used the 4-arg select instead of sleep to control it polling loop; it would be able to used a much smaller timeout, and notice when child processes finished in a more timely manner.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
        In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1126125]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-23 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found