[Stackless] stackless and multi-core

Andrew Francis andrewfr_ice at yahoo.com
Mon Apr 28 19:31:08 CEST 2008

Hi Jeff:

--- Jeff Senn <senn at maya.com> wrote:

> Hm.  I don't understand your analogy with the
> "watchdog".

I believe the watchdog in the Stackless scheduler
counts a given number of instructions before
interrupting a tasklet.

> It's "Global" so that lots of little incremental
> checks don't need to be sprinkled throughout the
>Python interpreter potentially slowing it down.


> And it would hurt you *a lot* if you had a lot of
> python that wanted to overlap and/or more than one
>process on your machine!!
> Typically you would use spin-locks for a situation
> where you are guarding access to something that is
>quickly locked and unlocked (and has a fairly high
>chance of not being locked when requested).  The GIL
>is the opposite -- it is almost always locked
(because >the python interpreter is almost always

Okay, I see your point. Now another naive question. If
one's Stackless programme uses only one OS thread -
why hae a GIL? How much overhead does this add?

Naive question/comment two. Perhaps for coarse grained
problems - for example, Stackless application (a game)
uses a Twisted reactor - perhaps the better way to
make use of multiple cores is  to have the
applications in separate processes/processors but
communicating through shared memory?


Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

More information about the Stackless mailing list