[Twisted-Python] How Twisted is This?

Glyph Lefkowitz glyph at twistedmatrix.com
Wed Jul 16 18:04:24 EDT 2003


On Wednesday, July 16, 2003, at 12:24 PM, Brad Bollenbach wrote:

> Using a state machine for this seems like too much complexity, compared
> to just starting a thread and letting me simply block so I can do these
> checks procedurally (albeit inside a method, if you know what I mean).

Keep in mind that nothing in Twisted is thread safe, so you will have 
to write a state machine to process the results of your threaded 
calculations anyway.  State machines are really the point of Twisted.  
The framework itself is a huge repository of different techniques and 
examples for making writing state machines easy.

If you're going to write a bunch of blocking I/O in threads, you might 
as well write your own framework.  You literally won't be able to 
safely call any Twisted code that way.  As an aside, running lots of 
threaded clients will tend to scale much more poorly than multiplexing 
them all.





More information about the Twisted-Python mailing list