multiple system calls running at the same time

G

guser

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
 
T

Tad McClellan

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?
 
X

xhoster

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
 
G

guser

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top