[Stackless] Population simulation in Stackless

Christian Tismer tismer at tismer.com
Sat Aug 24 21:09:04 CEST 2002


Aaron Watters wrote:
> 
> sdfrost at UCSD.Edu wrote:
> 
> 
>>Dear Aaron,
>>
>>Thanks for the link.  I've a quick question regarding your scheduler that I
>>hope isn't too dumb.  When I start it up on a two processor machine, the load
>>isn't balanced; I get the equivalent of 1 cpu's worth (which might be 100+0 or
>>90+10 or 65+35).  Given that tasktest.py balances just fine, what restricts the
>>balancing in world_new?

Which tasktest.py are you referring to? Mine?
I have no idea how a two processor machine handles
stacks. I can manage only one stack at all, and
if you try to switch between tasklets of different
threads, you will crash badly.

Is two processors like two threads? Same memory,
different stacks, and you need the lock?
The I have a reason to learn how to do this, now.
I thought never to need threads. But if this brings
a new CPU :-))

At the moment, I'm very busy porting IronPort's application
to stackless, but after that I might give it a try.

> Dunno.  I'm new to stackless myself.  "Normal Python" I think has a
> "global interpreter lock" which basically guarantees it will never use more
> than 1 cpu in the same process.  I don't know if Chris did anything to remove
> it, but I'd be a little frighted if he did (things like list.append aren't
> technically thread safe).

I didn't touch thread locking at all. I'm fiddling with one tstate
only and don't bite the bullet.

> ps: the best i can say right now is that if you launch 2 of them, both cpus
>   should fill up ;).

And that's the only thing I can recommend, unless you make
sure that there are really disjoint chains of tasklets
running which *dont* try to talk via a chan**crash**el

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