[Twisted-Python] Large file transfers

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Jul 30 01:22:31 MDT 2002


On Tue, 30 Jul 2002 11:57:30 +1000, abo at minkirri.apana.org.au (Donovan Baarda) wrote:
> G'day,
> 
> On Mon, Jul 29, 2002 at 10:35:59AM -0500, Glyph Lefkowitz wrote:
> > 
> > On Mon, 29 Jul 2002 12:35:31 +0300, Tommi Virtanen <tv at twistedmatrix.com> wrote:
> > > On Fri, Jul 26, 2002 at 07:41:27AM -0500, Chris Armstrong wrote:
> [...]
> 
> Does anyone else find it funny to have a discussion about the performance
> problems of select/poll/whatever on a list devoted to a server framework
> written in an (psedo-)interpreted scripting language :-)

Not at all.  Performance and scaling issues with the asynchronous networking
side of things are distinct from CPU load problems with data processing.
Especially when you're spending CPU time on being flexible and robust, it's
important to use the most efficient available mechanisms for doing the
low-level, well-understood tasks that you're basing your high-level logic on.

> > Hope this is enlightening.
> 
> I'm curious as to what this actually means. If I give an open file a fcntl()
> to set it to non-blocking and use it in a select(), what happens? Do I get
> undeterminite behaviour? Does the select always return the file immediately
> as ready, only to have the read (sometimes) block?

You can't set a file to non-blocking, basically.  It won't do anything.
select() will always say that files are readable, and those files will "block"
when you read from them.  Then again, this is *extremely* fast, at least on
linux systems.  (I don't know about BSD, but at least on Windows you can't even
*pass* a file fd to select; it will just give you an error.)

-- 
 |    <`'>    |  Glyph Lefkowitz: Traveling Sorcerer   |
 |   < _/ >   |  Lead Developer,  the Twisted project  |
 |  < ___/ >  |      http://www.twistedmatrix.com      |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20020730/75967034/attachment.sig>


More information about the Twisted-Python mailing list