|Syntactic Confectionery Delight|
Testing many devices - are threads the answer?by McDarren (Abbot)
|on May 12, 2009 at 13:22 UTC||Need Help??|
McDarren has asked for the
wisdom of the Perl Monks concerning the following question:
I have a challenge for which I _think_ the use of threads is possibly the answer. However, as threading is completely new and unchartered (and somewhat daunting) territory for me, I felt that it may be wise to consult the monks before diving in and getting a mouthful ;)
My problem can be summarised as follows:
In other words....
Currently, I run my test every 20 minutes, and it takes ~15 minutes to test every single AP. Because I need to allow for a time out, the run time will increase or decrease depending on the number of AP's detected as off line on any given run. Clearly, this is not scalable, and I'm going to have problems as the number of devices to be tested increases. So I need to find a more efficient way to do it.
I've done a bit of reading on Perl threads, and in particular the threads tutorial, and I suspect that what I'm looking for is a "Work Crew" model. But again, I'm not sure, so I'm seeking your collective advice...
PS. I probably should make mention of the fact that my current code is implemented as an extension for the Big Brother Network Monitoring Tool. That is, the reports that my code produces are fed into Big Brother.
Update: I feel quite overwhelmed by the number of responses and the variety of potential solutions offered. Proves once again the TIMTOWTDIness of Perl, and the value of Perlmonks as a community ('sif we didn't know these already). For the time being, I have a very quick & dirty implementation of Parallel:ForkManager working, which has solved my immediate problem. However, I fully intend to investigate most of the other solutions offered. So a big thank you to all those that offered their advice and comment :)