Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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.

Replies are listed 'Best First'.
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 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 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 roboticus (Chancellor) on Nov 08, 2012 at 02:35 UTC


    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.


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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1002724]
Approved by Corion
[Corion]: Yaerox: There is Encode::Guess, but that needs a limited set of inputs, and it also cannot handle multiple single-byte encodings
[Corion]: If you have a BOM, that's a really easy way to recognize UTF-8. Otherwise, you can try to decode a file from UTF-8, and if that works OK and doesn't crash, most likely the file was valid UTF-8
[Corion]: But as "ansi" (Latin-1?) is a single-byte encoding, any file is a valid ANSI file

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2017-03-28 13:21 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (332 votes). Check out past polls.