[Stackless] Realistic ticking and acting

stackless at kaishaku.org stackless at kaishaku.org
Fri Jul 14 03:10:50 CEST 2006


> > Is there an obvious flaw in my use of Stackless? (in Ticker5.py)
> > 
> > Can you implement Ticker7.py more elegantly Stackless?
> > 
> > --
> >  kai
> > 
> 
> I really do think you're making things more complex than they need to
> be. I've attached a (very rough) cleanup of your Ticker5.py; I don't
> think it'll make the list but it should get to you.  Let me know if it
> doesn't.
> 
> 
> -Grant

Ticker5 was a behemoth, I just wanted you to see the output and intent.
Your modifications take away much of the functionality and without the
time.sleep(0.5) in the ticker continuity in your modification is lost.

I think it is best we forget about the Ticker5 code and focus on its
output to understand my intent. However, Ticker7 does most of the same
with much less work in the code, so perhaps forget Ticker5 altogether.

Here is simple code:

  http://kaishaku.org/Ticker7simple.py

It works as expected and is easy to understand.

Attempting to convert to stackless I have problems right away:

  http://kaishaku.org/Ticker7simplestackless.py

I have simply created a tasklet for each actor, the ticker,
and given each actor a channel. Already there is a bug where
ticks are coming too fast, or actions don't happen for a tick.

Why?

Each step I take I seem to encounter these sorts of problems.
Remember, this is not real-time code. It's not about sending
a tick every X milliseconds/seconds, it's about sending a tick
when all the actors have executed their actions for that tick.

Can someone show a Ticker7simple.py implementation in stackless or
explain why my first steps in Ticker7simplestackless.py failed?

-- 
 kai

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list