From: Jason Roelofs Date: 2007-02-22T04:19:51+09:00 Subject: Re: threads within a thread ------=_Part_12395_5456323.1172085588174 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Since you're writing this in Ruby, I have to suggest that you just write this single-threaded. Ruby uses green threads, meaning it handles it's own threading and not the system, leading to on average decreased execution time vs single-threaded. That said, there should be nothing stopping you from having threads starting up other threads. However, said new threads will not be contextually constrained in any way (there is no Thread Hierarchy, as you seem to be looking for). You'll just have to make sure that the Port threads are given the hostname and port to watch for before letting them go. Jason 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. > > > ------=_Part_12395_5456323.1172085588174--