[Stackless] stackless & multithreaded apps on multi-cpu boxes
aaron at reportlab.com
Sat Oct 26 18:39:49 CEST 2002
Christian Tismer wrote:
> Michal Vitecek wrote:
>> 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 a bit better than that. Any extension module that wants
to allow multiple threads (and is willing to guarantee thread safety) can
release the lock and reacquire it before returning to the interpreter.
This is done for IO and database access and other things.
So if the application spends a lot of time in thread safe extensions you
could be using more than one CPU much of the time.
For example internet applications that do a lot of socket IO may
be using all the cpus if they spend most of their time moving bighunks
-- Aaron Watters
More information about the Stackless