asyncore, asynchat and threads

Peter Hansen peter at engcorp.com
Tue Aug 3 21:49:20 EDT 2004


Joshua Moore-Oliva wrote:

> However, I must use a separate thread for each connection as the work 
 > resulting from the communication can result in blocking for an 
indefinate
 > period of time.
...
> even any pointers, help, ideas on how to make something like this work 
 > would be greatly appreciated as well.

The usual approach is to use something along the lines of a separate
thread for the *work* rather than for the connection, or maybe a
thread pool, and communicate with those threads from the asynchat
thingies using Queue.Queues...

I'm not sure we have enough information about what you really need
to say more.  You've given lots of info about what you "would love
to do" but not enough about what you actually need to do. <wink>

-Peter



More information about the Python-list mailing list