[Tutor] Threads

Kent Johnson kent37 at tds.net
Mon Nov 15 23:58:12 CET 2004


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.


More information about the Tutor mailing list