Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Multiple system commands in parallel

by Your Mother (Archbishop)
on May 09, 2016 at 22:08 UTC ( [id://1162577]=note: print w/replies, xml ) Need Help??


in reply to Multiple system commands in parallel

I personally would reach for Parallel::ForkManager and Capture::Tiny; and most certainly add use strict; and use warnings; :P Plenty of approaches and if this is a throwaway script, without a need to speed-limit, a simple fork might do.

Replies are listed 'Best First'.
Re^2: Multiple system commands in parallel
by BrowserUk (Patriarch) on May 09, 2016 at 22:43 UTC

    Under Windows, both P::FM and fork use threads; which doesn't address the OPs problem.


    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 knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.

      The problem seems to be synchronous v asynchronous. Do threads run synchronously in WIN when paired with system? Is all that is necessary to use exec which Tanktalus already mentioned and I had, perhaps wrongly assumed, was already part of the advice here?

        Do threads run synchronously in WIN when paired with system?

        Obviously not; but did you read the OPs reply to Tanktalus?

        Any processes spawned by system, from threads or not, will run within the same console, thus will be aborted if the parent is aborted by ^c.


        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 knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.
        Is all that is necessary to use exec

        Have you thought about what happens if you exec after a (pseudo-)fork?


        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 knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-26 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found