Python threads: backed by OS threads?

Konrad Hinsen hinsen at
Thu May 11 20:33:22 CEST 2000

Courageous <jkraska1 at> writes:

> Okay, I simply have to know for sure that Python
> threads are backed by full operating system threads.

They are.

> To wit: if I create multiple Python threads on a
> machine with multiple CPUs, I should be expecting
> take advantage of the additional CPU's, correct?

Not necessarily. The Python interpreter is not fully thread-safe,
therefore only one thread at a time can execute interpreted Python
code. The only way to take advantage of multiple CPUs is by executing
time-consuming C code, called from Python after releasing the
interpreter lock. The details are explained in the Extending & Embedding
manual at
Konrad Hinsen                            | E-Mail: hinsen at
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-
Rue Charles Sadron                       | Fax:  +33-
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais

More information about the Python-list mailing list