[Stackless] stackless & multithreaded apps on multi-cpu boxes

Christian Tismer tismer at tismer.com
Fri Oct 25 10:35:06 CEST 2002

Michal Vitecek wrote:
>  hello,
>  i learned on python mailing list that python cannot utilize multiple
>  cpus in one process-multiple threads because of GIL (global interpreter
>  lock). what is the situation in stackless? can someone please tell me?

The situation is exactly the same, unless I do something
about it. I'm planing for some MPI interface work for next
year. Concerning the GIL, I haven't yet decided which
way to go. Multiple CPU's directly with Python aren't
possible without socalled "three-threading" patches,
which have been reported to be about 20-30% slower
that native Python with the GIL.
There are alternatives, of course. Some applications
don't need tight integration of CPU's in one process,
they can instead do with one process per CPU and a loose
coupling by IPC.
Another one, which would apply to things like number
crunching on vectors or matrices would be to allow
the CPU collaboration in special expension modules
only, which don't need the GIL. I could think of a
special version of the numeric extension, where it
might be considerable to have just the computations
run on multiple CPUs.

Have to think more about this - ciao - chris

Christian Tismer             :^)   <mailto:tismer at tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  pager +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/

Stackless mailing list
Stackless at www.tismer.com

More information about the Stackless mailing list