Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > multiple system calls running at the same time

Reply
Thread Tools

multiple system calls running at the same time

 
 
guser@packetstorm.org
Guest
Posts: n/a
 
      06-21-2006
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

 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      06-21-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> 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
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      06-22-2006
(E-Mail Removed) 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
 
Reply With Quote
 
guser@packetstorm.org
Guest
Posts: n/a
 
      06-22-2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
write to the same file from multiple processes at the same time? gabor Python 19 05-31-2005 01:57 PM
Re: write to the same file from multiple processes at the same time? Jp Calderone Python 4 05-31-2005 07:54 AM
Re: write to the same file from multiple processes at the same time? Jp Calderone Python 7 05-28-2005 06:47 PM
Re: write to the same file from multiple processes at the same time? Jp Calderone Python 0 05-27-2005 02:17 PM
running multiple threads and multiple processes at the same time Smegly C Programming 1 05-19-2004 02:59 AM



Advertisments