[Stackless] Santa concurrency problem

Carlos Eduardo de Paula carlosedp at gmail.com
Thu Apr 12 14:30:27 CEST 2007


Nice solution, but the problem is that we still have the CPU
hogging...  I think the sleepUntil loop in Timer class is eating up
the CPU resource here.. maybe we can have an approach like the
time.sleep() in ManageSleepTasklets...

Carlos

On 4/12/07, Stephan Diehl <stephan.diehl at gmx.net> wrote:
> I think I've fixed it (see http://dpaste.com/hold/8360/)
> The problem seemed to be that the 'stackless.run' method doesn't check
> if there are any waiting tasklets left. The monkeypatched stackless.run
> does the trick. Other than that, I've only done some tiny, little fixes.
>
> Stephan
>
> Carlos Eduardo de Paula wrote:
> > Returning to our santa example, I tried to use the new Timing approach on it.
> >
> > I applied it monkeypatching the sleep function but found a problem,
> > when using the old approach (ManageSleep) the app runs forever but
> > when I started using this one, the app stops running after random
> > time. I think its a problem related to the management of the blocked
> > tasklets...
> >
> > The code can be seen here:
> >
> > http://dpaste.com/hold/7800/
> >
> >
> > Carlos
> >
> > On 3/30/07, Christian Tismer <tismer at stackless.com> wrote:
> >> On 30.03.2007, at 18:37, Carlos Eduardo de Paula wrote:
> >>
> >>> Hi Chris,
> >>>
> >>> take a look at the changes I made in QueuedTimer, It now uses a
> >>> heapq.. I kept the old way commented just for clarification.. Do you
> >>> think it performs better now or its the same.
> >> looks pretty good.
> >> I think we simply use it and trash my silly dict approach.
> >>
> >
> >
>
>


-- 
-------------------------------------------------------------------
Visit Stackless Examples Project
http://code.google.com/p/stacklessexamples/
Stackless Python - www.stackless.com
-------------------------------------------------------------------

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



More information about the Stackless mailing list