[Twisted-Python] Migrate Asyncore to Twisted

Christopher Armstrong radix at twistedmatrix.com
Thu Mar 15 16:01:11 EDT 2007


On 3/15/07, jian wu <hellojianwu at gmail.com> wrote:
> Hi,
>
> > Twisted doesn't need threads for this at all. Nor does asyncore.
>
> >From what I understand, it is better using threads to offload any
> blocking operation out of Twisted main event loop unless all your
> message processing is non-blocking or "light-weight and fast"
> ( Sometimes message processing plus state management could
>  be heavy operations ).

Ideally, you're not really offloading *processing* but just stuff like
disk or database I/O, and only when necessary. It's often worthwhile
finding the minimal amount of code to throw into a thread.

-- 
Christopher Armstrong
International Man of Twistery
http://radix.twistedmatrix.com/
http://twistedmatrix.com/
http://canonical.com/




More information about the Twisted-Python mailing list