Tuesday, November 11, 2008

Multithreading in Python, revisited

I wrote about multithreading support in Python earlier.

Turns out that while python has full support for threads, the CPython interpreter will interpret Python bytecode only one thread at a time, enforcing de-facto serialization of your parallel code.

Come to think of it, it is the worst possible multithreading solution. You get all the problems of parallel programming, and no speed benefit at all. Though could be useful for prototyping alone. It is definitely a bad idea for production code though.

No comments: