Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Process Management script

by Anarchy (Initiate)
on Nov 07, 2012 at 19:35 UTC ( #1002724=perlquestion: print w/ replies, xml ) Need Help??
Anarchy has asked for the wisdom of the Perl Monks concerning the following question:

What is the best way of handling a large amount of processes?

Basically what I am wanting is to have a script where all my processes are stored, and then I want a number of other scripts to just connect to this process manager script to run the processes that it needs to.

Comment on Process Management script
Re: Process Management script
by space_monk (Chaplain) on Nov 07, 2012 at 20:01 UTC
    I think you need to give some more detail - for one thing you haven't explained why you don't just get your scripts to run the processes it needs to directly, thus saving yourself a complete level of complexity.
Re: Process Management script
by blue_cowdawg (Monsignor) on Nov 07, 2012 at 20:48 UTC
        Basically what I am wanting is to have a script where all my processes are stored,

    eh? not sure what you mean by that.....

        then I want a number of other scripts to just connect to this process manager script to run the processes that it needs to

    Why? Why not just have the "number of other scripts" invoke the processes as needed? If you are concerned about starting multiple instances of the same process of some reason why not search the process table and see if it is already running? In some cases there should be a lock file you could look at.

    The information you have failed to provide:

    • What's the environment? *nix? Winbloze? VMS? Atari?
    • What kind of processes are they? Daemons? Filters? Elvis?
    • What's the rationale for managing the processes in the first place?
    and answers to those questions might lead to others.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Re: Process Management script
by Tanktalus (Canon) on Nov 07, 2012 at 20:49 UTC

    Seeing as I'm waiting for my code to compile, I'm going to pull out a magic ball and see what I can make from it.

    First off, how do you "store" a process? A process is either running or it is not. The concept of "storing" a process? No comprendo.

    Peering into the magic ball, I wonder if you mean that you're storing a table of processes. Is your goal to connect to this service, request a function, which causes the service to launch a corresponding process in some way? This is not significantly different, then, from xinet or even a web service that redirects to many CGI scripts based on the URL. Or even, really, a remote procedure call (RPC) in general, though that doesn't necessarily involve subprocesses.

    So... the best way? Well, seeing as my crystal ball is still very hazy, I'm not even sure I got that much right, I'm not feeling confident enough to pick a best for that. Nor am I sure what "best" would be - to me it would depend on the design of the rest of the system, I guess.

Re: Process Management script
by roboticus (Canon) on Nov 08, 2012 at 02:35 UTC

    Anarchy:

    You might look at the make utility available on many *nix systems. If you have timestamped results files, you can generate a set of rules to execute whatever needs to be run.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1002724]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (15)
As of 2014-10-01 15:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (29 votes), past polls