thread help
Scott David Daniels
Scott.Daniels at Acm.Org
Tue Jun 15 03:27:08 EDT 2004
Aahz wrote:
> Bart Nessux <bart_nessux at hotmail.com> wrote:
>>Could someone show me how I can make this work correctly? I want to probe
>>64 unique IP address for HTTP servers simultaneously, ...
> Create a threading.Thread subclass that takes one IP address and a list
> of ports to scan. Start 64 instances of this class, each with a
> different IP address.
An alternative is to create a que into which you push IP addresses to
contact, and have each thread read addresses off the queue when they are
free to process them. This has the advantage of decoupling the number
of threads from the number of addresses you want to examine.
-Scott David Daniels
Scott.Daniels at Acm.Org
More information about the Python-list
mailing list