I\'d like to parallelize my Python program so that it can make use of multiple processors on the machine that it runs on. My parallelization is very simple, in that all the
multiprocessing
is a great Swiss-army knife type of module. It is more general than threads, as you can even perform remote computations. This is therefore the module I would suggest you use.
The subprocess
module would also allow you to launch multiple processes, but I found it to be less convenient to use than the new multiprocessing module.
Threads are notoriously subtle, and, with CPython, you are often limited to one core, with them (even though, as noted in one of the comments, the Global Interpreter Lock (GIL) can be released in C code called from Python code).
I believe that most of the functions of the three modules you cite can be used in a platform-independent way. On the portability side, note that multiprocessing
only comes in standard since Python 2.6 (a version for some older versions of Python does exist, though). But it's a great module!