CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced: Re: [guruk] Remote monitoring using multi-threading: Edit Log



7stud
Enthusiast

Mar 18, 2010, 2:04 AM


Views: 1546
Re: [guruk] Remote monitoring using multi-threading

Why would you need to simultaneously test all 100 devices? You are going to be pinging them more than once right? Why can't you just use a while loop and poll each ip address in succession?


If for some reason that won't work for you, a thread strategy might be to put all the ip addresses in a Thread::Queue, and then use threads::shared to share the queue between all the threads. Then start 10 or so threads that execute the same function. The function would grab an ip address from the queue, then do the test on the ip address and sound an alarm if necessary. The final step would be to add the ip address to the end of the queue. A Thread::Queue is thread safe, so you don't have to worry about locks or anything like that.


(This post was edited by 7stud on Mar 18, 2010, 5:05 AM)


Edit Log:
Post edited by 7stud (Enthusiast) on Mar 18, 2010, 2:06 AM
Post edited by 7stud (Enthusiast) on Mar 18, 2010, 2:08 AM
Post edited by 7stud (Enthusiast) on Mar 18, 2010, 2:09 AM
Post edited by 7stud (Enthusiast) on Mar 18, 2010, 5:05 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives