[Stackless] multi-core processing?

Jeff Senn senn at maya.com
Mon Jun 16 15:14:34 CEST 2008


One quick (perhaps barely relevant) clarification:
Simon mentions "spawning multiple Python interpreters through the C/ 
Python API"

Even if you use the C API to create multiple interpreters in the same
processes (but in different threads), you will STILL be at odds with  
the GIL.

The GIL is held in a static variable of the interpreter code (Python/ 
ceval.c)
so you really do need to arrange for separate PROCESSES. (Separate  
static spaces
for the Python libraries).

It sounds like you are running separate processes and are good...

On Jun 16, 2008, at 8:44 AM, Simon Pickles wrote:
>> If you're using multiple processes, then you get parallel execution  
>> on
>> either SMP or clusters. The GIL is per-process.
>>
>> I mention this because it seems to be pointless to use PB to
>> communicate between components within a single process, so I assume
>> you must be using multiple processes. Or are you spawning multiple
>> Python interpreters through the C/Python API?
>>
> Phew! That was a brown-trousers moment.
>
> I am spawning multiple interpreters, some on SMPs, some across a  
> cluster. This arrangement is flexible so I  used PB to provide that   
> versatility.
>
> Good to know 12 months work hasn't been barking up the wrong tree.  
> Perhaps a simple core test would have reassured me!





More information about the Stackless mailing list