Notes
[translated roughly from Hebrew]
Introduction
- Name: Moshe Zadka
- Twisted developer [Debian, Python]
- Not:
- XML talk (XML is: standarised, flexibl, internationalized)
- Gettysburg in Power Point
- Touching lots of things briefly
How to do more than one thing at once?
- Fork (Apache)
- Thread (AOLServer)
- Cheat (GUI programs)
- Main loop calling our code.
- Let's develop a network program!
Discussion
- What is blocking?
- There is a UNIX concept of blocking...
- ...which is not really relevant.
- Connecting to an accepting UNIX domain socket is blocking...
- ...reading a file from NFS is not.
- Wait a minute: why is that interesting?
- GUI -- humans (0.1s-1s)
- Network: connections might get refused
- Typical scenario: listen buffer 5, 1e6 connections/day --
don't dawdle for more than 0.08s
- These are the numbers that matter!
- Useful criterion: blocking==takes more than 0.01s on normal load.
- Depends on hardware, etc.
- Real world :(
- But a useful rule of thumb when coding.
- Trick: reactor.callLater(0,)
- Continuation-passing-style, tail-call-optimization
- But not pure -- not optimal
References
- Plonk
- twistedmatrix.com
- mailing list
- irc -- #twisted