Imported Upstream version 12.1.0
[contrib/python-twisted.git] / doc / historic / 2003 / haifux / notes.html
1 <html><head><title>Notes</title></head><body>
2 <h1>Notes</h1>
3
4 <p>[translated roughly from Hebrew]</p>
5
6 <h2>Introduction</h2>
7
8 <ul>
9 <li>Name: Moshe Zadka</li>
10 <li>Twisted developer [Debian, Python]</li>
11 <li>Not:<ul>
12 <li>XML talk (XML is: standarised, flexibl, internationalized)</li>
13 <li>Gettysburg in Power Point</li>
14 <li>Touching lots of things briefly</li>
15 </ul></li>
16 <ul>How to do more than one thing at once?<ul>
17 <li>Fork (Apache)</li>
18 <li>Thread (AOLServer)</li>
19 <li>Cheat (GUI programs)</li>
20 </ul></li>
21 <li>Main loop calling our code.</li>
22 <li>Let's develop a network program!</li>
23 </ul>
24
25 <h2>Discussion</h2>
26
27 <ul>
28 <li>What is blocking?
29 <ul>
30 <li>There is a UNIX concept of blocking...</li>
31 <li>...which is not really relevant.</li>
32 <li>Connecting to an accepting UNIX domain socket is blocking...</li>
33 <li>...reading a file from NFS is not.</li>
34 </ul></li>
35 <li>Wait a minute: why is that interesting?<ul>
36 <li>GUI -- humans (0.1s-1s)</li>
37 <li>Network: connections might get refused</li>
38 </ul></li>
39 <li>Typical scenario: listen buffer 5, 1e6 connections/day --
40     don't dawdle for more than 0.08s</li>
41 <li>These are the numbers that matter!</li>
42 <li>Useful criterion: blocking==takes more than 0.01s on normal load.</li>
43 <li>Depends on hardware, etc.</li>
44 <li>Real world :(</li>
45 <li>But a useful rule of thumb when coding.</li>
46 <li>Trick: reactor.callLater(0,)</li>
47 <li>Continuation-passing-style, tail-call-optimization</li>
48 <li>But not pure -- not optimal</li>
49 </ul>
50
51 <h2>References</h2>
52
53 <ul>
54 <li>Plonk</li>
55 <li>twistedmatrix.com</li>
56 <li>mailing list</li>
57 <li>irc -- #twisted</li>
58 </ul>
59
60 </body></html>