[Zope3-dev] Asyncore (and Twisted)

Shane Hathaway shane@zope.com
Fri, 01 Nov 2002 09:40:34 -0500


Chris Withers wrote:
> Shane Hathaway wrote:
> 
>>
>> Well, I don't think networking from threads is the real goal.  What's 
>> important is that Zope's ZODB connections are scarce and precious, so 
>> time spent in application code must be minimized.  To help achieve 
>> this, Zope threads must never block for I/O except in rare cases.  
>> Therefore all input and output must be fully buffered.
> 
> 
> How does this interact with the (admittedly edge) case of pages where 
> you want to write the output bit by bit?
> (I'm thinking things like the dots that ZUnit used to write out...)

In cases like that, without the optimization, the thread must block 
waiting for the main loop, which in turn waits for I/O.  With the 
optimization, the thread can avoid the main loop and do I/O itself.  But 
like you said, this is an edge case.

Shane