Sign in or Join FriendFeed
FriendFeed is the easiest way to share online. Learn more »
Jim Norris
17.6. multiprocessing — Process-based “threading” interface — Python v2.6.4 documentation - http://docs.python.org/library...
"multiprocessing is a package that supports spawning processes using an API similar to the threading module. The multiprocessing package offers both local and remote concurrency, effectively side-stepping the Global Interpreter Lock by using subprocesses instead of threads. Due to this, the multiprocessing module allows the programmer to fully leverage multiple processors on a given machine. It runs on both Unix and Windows." - Jim Norris from Bookmarklet
Spooky. I have had this page open in a browser window for the past week. - Gabe
Interesting. I was not aware that Python has multiprocessing lib. Can someone teach me how commonly this module used by pythonista? For example, is FriendFeed using it? The best part I like about Java is its java.util.concurrent package and I wish I could add this kind of feature to Ruby someday. (I'm nahi at ruby-lang.org, one of a std-lib committer) - NaHi from f2p
I wasn't aware of it either, and I don't think it's commonly used, but it's pretty interesting. FriendFeed mainly uses Tornado's nonblocking event-driven architecture along with a little bit of multithreading. - Jim Norris
I had stumbled upon this a few weeks ago; works great for those cases where you want to take some else's (potentially non multi-* aware) code and throw it across all of your cores. - Eric Borisch
Jim: Thanks for comment. I found that multiprocessing module is bundled as a std-lib from Python 2.6 (2008-10-01, PEP 371). Widely adoption is yet to come and you picked this as a topic; I've understood now. And for me it's interesting to know that FriendFeed mainly uses Tornado's events for background jobs. Jobs I thought are search indexer, keyword matcher, index table updater, cleaner, etc. I thought these jobs needs to be passivated/backup-ed and restored but it may not be needed by careful design. - NaHi from f2p
(Sorry for Ruby topics) GIL is a hot topic in Ruby world as well and Matz (Ruby designer and CRuby developer) seems to think it may not be a serious problem in this many-core era. He's also driving projects for MVM (multi-VM) and distributed KVS. - NaHi from f2p