[Tutor] Threads

orbitz orbitz at ezabel.com
Tue Nov 16 00:11:31 CET 2004


I'm fairly biased, but I suggest twisted. It has an HTTP client, 
although it isn't 1.1 compliant (or have anything with 1.1 as far as I 
know).  Asyncore isn't very good from what I hear, which is why the 
author has gone on to make 2 other async libraries.


Kent Johnson wrote:

> orbitz wrote:
>
>> Why waste your time using threads for this? Network I/O is so dang 
>> slow using threads will not make the downloading any faster.  Using 
>> async/non-blocking sockets should be fine and easier to program, less 
>> worry of deadlock's and easier to debug IMO.
>
>
> Would you use asyncore or asynchat and raw socket IO, then? How would 
> you deal with redirects and other complications of HTTP? Or is there a 
> way to use non-blocking sockets with urllib?
>
> Really trying to understand this time...
> Kent
>
>>
>>
>> Terry Carroll wrote:
>>
>>> I'm toying with using threads for an app I have in mind.  The Queue 
>>> module you point out looks like just the ticket for what I'm 
>>> thinking of.
>>>
>>> One question I do have on threads, though.  In my app, a finite 
>>> number (12-50) requests including URLs would be put on the queue, 
>>> and multiple (2-4) consumer threads would pick things off the queue 
>>> to process.
>>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>



More information about the Tutor mailing list