[Twisted-Python] win32 event loop

Itamar Shtull-Trauring twisted at itamarst.org
Mon May 6 10:29:32 MDT 2002


The problem - WaitForMultipleObjects, which is like poll() for Windows, 
won't work with more than 64 events. MS did this since apparently it scales 
really really badly.

[Subtext: Microsoft hates me]

So I've done some research, and it looks like I/O Completion ports are the 
way to go for scalable networking. This will probably mean rewriting (or 
subclassing) the stuff in tcp.py and abstract.py, since this the Proactor 
pattern, not the Reactor pattern, so things work a bit differently. I'm not 
even sure how UDP is done, but that's something I'll worry about later.

[Subtext: Microsoft create more useless work for me]

Another issue is the SSL support, which won't work with this method... We'd 
have to use Windows specific SSL code.

[Subtext: Microsoft breaks my code]

Another alternative is using threads with multiple WaitForMultipleObjects. 
This, I would guess, is probably really slow.

[Subtext: Microsoft slows down my software]






More information about the Twisted-Python mailing list