From: Francis Cianfrocca Date: 2007-02-22T06:27:32+09:00 Subject: Re: threads within a thread ------=_Part_16620_21495793.1172093237391 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 2/21/07, Brad Tilley wrote: > > I have a program that uses threads to quickly check class B networks > (65,536) > hosts for public web servers. It works great. I'd like to check for other > servers as well. Basically, I've got the hosts threaded. Now, I'd like to > thread the ports so that while the hosts are being probed concurrently > that > ports on the hosts could be probed concurrently as well. It might look > like > this: > > A Thread > host > A Thread > port 80 > port 443 > port 25 > host > A Thread > port 445 > port 139 > host > A Thread > ... > > I can demonstrate actually code (with only threaded hosts) if that would > be > helpful, but I'd rather keep it abstract and discuss how to handle threads > within a thread... hope that makes sense. > > > What's the nature of the probe that you're doing? A TCP connect on a given port? If so, look at EventMachine (on Rubyforge). You may be able to significantly improve on your runtime. ------=_Part_16620_21495793.1172093237391--