LWN.net Logo

Moving to Python 3

Moving to Python 3

Posted Feb 14, 2011 19:26 UTC (Mon) by cmccabe (guest, #60281)
In reply to: Moving to Python 3 by kleptog
Parent article: Moving to Python 3

> I'm not a huge fan of threads but where they mostly come in is dealing
> with I/O. Say you have an app that has to send/receive data over 3
> different pipes and in between it also has to do actual work. While you
> can write a main loop that does a select() over each descriptor and calls
> the right code when something becomes readable/writable, it's conceptually
> much clearer having a thread whose job it is to read any data and process
> it. Especially when you have to deal with issues like write() blocking,

Twisted is a great way to do multiple I/O operations without using threads. It wraps the ugly select() interface in something much nicer.

http://en.wikipedia.org/wiki/Twisted_(software)


(Log in to post comments)

Moving to Python 3

Posted Feb 17, 2011 8:10 UTC (Thu) by rqosa (subscriber, #24136) [Link]

Or libevent with pyevent (or with gevent).

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds