[Stackless] stackless and threads

Christian Tismer tismer at tismer.com
Sat Jul 12 23:44:15 CEST 2003


Vladimir Vukicevic wrote:

> Howdy..
> 
> I've been playing with stackless for the past little while, and am
> wondering how it interacts with native (OS) threads.  Python's native
> threading situation is somewhat less-than-stellar anyway (global
> interpreter lock); I'm wondering what happens when stackless is
> introduced into a multithreaded app.

At the moment, under circumstances, it will crash.
I had that complaint before. What I have to do at least
is to avoid switches between tasklets from different threads.
I don't know whether it makes sense to build real thread
switching into tasklets, or just let them raise an exception.

> I'm wrapping a library that uses threads internally (Ice, www.zeroc.com)
> using boost::python.  I just finished some patches for boost::python
> that make it manage the thread and GIL state correctly, so that Ice
> dispatches that are implemented in python can be correctly executed on
> arbitrary threads.  I'd like to get stackless in the mix, but I
> currently depend on python 2.3, due to the new
> PyGILState_Ensure/_Release calls.. I can backport this to 2.2/stackless
> though (I think).  Is the whole thing going to blow up in my face, or do
> I have a chance of things working?

I am working son some refinements and on the 2.3 port as well.
So, with a little patience, you will get Stackless for 2.3
in short time. I was thinking of doing a 2.2.3 port first,
but then the schedule for 2.3 was shortened so much.

> Also, Christian, is a copy of your EuroPython talk on stackless
> available anywhere online?

No, it is not, and I decided to not publish it, since I used
almost none of the slides. But you can have a copy, although,
well, I doubt it makes sense.

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
http://www.tismer.com/mailman/listinfo/stackless




More information about the Stackless mailing list