multiple system calls running at the same time

Discussion in 'Perl Misc' started by guser@packetstorm.org, Jun 21, 2006.

  1. Guest

    I have a program that acts as a scheduler and when items in the
    database need to be updated it calls an external program.

    Right now, it is slow as each call to the external program must finish
    before control is returned to the scheduler program.

    I read through ch 16 in the perl cookbook but I see nothing on running
    multiple programs at once. The Advanced Perl programming book did not
    seem to have anything on this either.

    If this is possible, would someone post an example or direct me to
    where I can read up on this?

    thanks
     
    , Jun 21, 2006
    #1
    1. Advertising

  2. <> wrote:

    > each call to the external program must finish
    > before control is returned to the scheduler program.



    > running
    > multiple programs at once.



    > If this is possible, would someone post an example or direct me to
    > where I can read up on this?



    Your Question is Asked Frequently:

    perldoc -q background

    How do I start a process in the background?


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Jun 22, 2006
    #2
    1. Advertising

  3. Guest

    wrote:
    > I have a program that acts as a scheduler and when items in the
    > database need to be updated it calls an external program.
    >
    > Right now, it is slow as each call to the external program must finish
    > before control is returned to the scheduler program.


    I doubt that that is why it is slow. It is probably slow because you are
    starting up an external program every time you do an update.

    If the only thing that prevents you from starting processes faster is that
    you have to wait for them to end before you regain control, just imagine
    what is going to happen you bypass this problem and start spawning
    processes faster than they exit.

    > I read through ch 16 in the perl cookbook but I see nothing on running
    > multiple programs at once. The Advanced Perl programming book did not
    > seem to have anything on this either.
    >
    > If this is possible, would someone post an example or direct me to
    > where I can read up on this?


    perldoc -q background

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
     
    , Jun 22, 2006
    #3
  4. Guest

    Thanks for the information. It pointed me to the POE project which
    appears to be just what I was looking for.

    Basically when the scheduler calls the poller script, the script delay
    is caused if the poller has never discovered the node and has not
    stored the community string (using net-snmp perl). A 3 second timeout
    per attempt for N community strings can cause alot of delay before the
    program stores the data (stored as a placeholder node if it cannot walk
    the device, otherwise more data is populated into the db).

    Looking over the POE docs I think the Child Process 3 cookbook example
    will be what I am looking for. Plus it even includes an example of
    limiting the children so the program does not go wild spawning child
    procs.

    -Greg
     
    , Jun 22, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Smegly
    Replies:
    1
    Views:
    1,133
    Mitchell
    May 19, 2004
  2. gabor
    Replies:
    19
    Views:
    1,161
    Steve Holden
    May 31, 2005
  3. Jp Calderone
    Replies:
    7
    Views:
    1,234
    Mike Meyer
    May 28, 2005
  4. Jp Calderone
    Replies:
    0
    Views:
    472
    Jp Calderone
    May 27, 2005
  5. Richard Tobin
    Replies:
    24
    Views:
    819
Loading...

Share This Page