Thanks everyone!  I got my script to work and thanks to Parallel::ThreadManager I am able to easily control the max number of threads, etc.  <div><br></div><div>TriLug rocks!</div><div><br></div><div>Greg<br><br><div class="gmail_quote">
On Sun, Mar 13, 2011 at 7:22 PM, Greg Brown <span dir="ltr">&lt;<a href="mailto:gwbrown1@gmail.com">gwbrown1@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I don&#39;t know if anyone cares but I tried both examples using time to see how much, well, time both took to run and these are the results (again I don&#39;t think this says much, and I&#39;m not sure what it does say if anything, but I found it interesting all the same):<div>

<br></div><div>Forks:</div><div><br></div><div><div>real<span style="white-space:pre-wrap">        </span>0m10.011s</div><div>user<span style="white-space:pre-wrap">        </span>0m0.007s</div><div>
sys<span style="white-space:pre-wrap">        </span>0m0.011s</div><div><br></div><div>Threads:</div><div><br></div><div><div>real<span style="white-space:pre-wrap">        </span>0m10.024s</div><div>
user<span style="white-space:pre-wrap">        </span>0m0.022s</div><div>sys<span style="white-space:pre-wrap">        </span>0m0.008s</div></div><div><div></div><div class="h5"><br><div class="gmail_quote">On Sun, Mar 13, 2011 at 5:33 PM, Greg Brown <span dir="ltr">&lt;<a href="mailto:gwbrown1@gmail.com" target="_blank">gwbrown1@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I found a good example using both threads and forks to accomplish a basic script that I thought I&#39;d pass along.<div>

<br></div><div><a href="https://wiki.bc.net/atl-conf/pages/viewpage.action?pageId=20548191" target="_blank">https://wiki.bc.net/atl-conf/pages/viewpage.action?pageId=20548191</a></div>
<div><br></div><div><font color="#888888">Greg</font><div><div></div><div><br><br><div class="gmail_quote">On Fri, Mar 11, 2011 at 12:11 PM, Michael Peters <span dir="ltr">&lt;<a href="mailto:mpeters@plusthree.com" target="_blank">mpeters@plusthree.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On 03/11/2011 10:00 AM, Brian Weaver wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I don&#39;t know about using threads, but if you want multiple instances with each working on a single device then why not use a master-child process model? Have the master fork off N children and maintain a link using anonymous pipes, unix sockets, or some other IPC mechanism. The master can inform each child on what system to query and then receive a status back from the child when it&#39;s done.<br>



</blockquote>
<br></div>
I agree that you should use processes instead of threads. Threads are ok in Perl but processes are better and since processes are COW in Linux you end up having about the same amount of overhead.<br>
<br>
But instead of writing your own from scratch, I&#39;d look to CPAN (Perl&#39;s biggest weapon) to find something to handle all of the gory bits for you. I like Parallel::ForkManager<br><font color="#888888">
<br>
-- <br>
Michael Peters<br>
Plus Three, LP</font><div><div></div><div><br>
_______________________________________________<br>
Trilug-ontopic mailing list<br>
<a href="mailto:Trilug-ontopic@trilug.org" target="_blank">Trilug-ontopic@trilug.org</a><br>
<a href="http://www.trilug.org/mailman/listinfo/trilug-ontopic" target="_blank">http://www.trilug.org/mailman/listinfo/trilug-ontopic</a><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>