[SciPy-user] dual core scipy in windows (signal.lsim2)

A. M. Archibald peridot.faceted at gmail.com
Sat Nov 25 17:36:17 CST 2006

On 25/11/06, Gael Varoquaux <gael.varoquaux at normalesup.org> wrote:
> This is due to ain intrinsic limitation of python (the way it is
> currently programmed). The python interpretor is not a multithreaded
> program. Two python instruction cannot execute in the same time. This is
> garantied by something known as the "global interpretor lock". C code
> called by python can release the GIL and let the python interpretor run
> other threads in parallel, but when the c call finishes the GIL rules
> again. Workaround involve using different instances of the python
> interpretor and doing some message passing between. The next version of
> ipython will use this technic, but it is clearly not part of normal
> python's feature.

Speaking from experience, the global interpreter lock need not be an
obstacle to using python's threads to parallelize CPU-intensive code,
particularly numeric code. It is perfectly possible to get two threads
churning away using all the CPU time on both of two processors without
any special tricks. Only certain applications are affected by the
global interpreter lock.

A. M. Archibald

More information about the SciPy-user mailing list