Is Stackless and uthread.py SMP friendly?

Konrad Hinsen hinsen at cnrs-orleans.fr
Tue Dec 19 08:22:47 EST 2000


jbalding at hotmail.com writes:

> Okay. My next question: Is there a simple way of taking advantage of
> multiple processors using Python, or is this something that is going to

Unless your code spends most of its time in purpose-written C code,
threads are not the way to go, so you need multiple independent Python
processes. There are a couple of packages out there that can help with
coordinating such processes. For example, you can use an MPI
implementation (there are at least two free ones, MPICH and LAM) with
a Python interface (e.g. the one in ScientificPython) and add some
high-level code for task administration etc.

This is not as complicated as it sounds; the most difficult part is
installing everything. And MPI makes sense on shared-memory machines
as well; a good MPI implementation handles message exchange via shared
memory when possible. However, for some problems message-passing is
more difficult to use than shared memory communication.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------



More information about the Python-list mailing list