[Stackless] Problems with removing tasklet.

Jeff Senn senn at maya.com
Wed Oct 9 22:43:30 CEST 2002


Christian Tismer <tismer at tismer.com> writes:
> He uses the run_watchdog thing with a very small timeout,
> with turns the watchdog into something that interrupts
> the current tasklet very frequently.
> You then just insert() the tasklet which puts it at the
> end of the chain again, and then run_watchdog(small number)
> again to schedule the next one.

Actually, although I do fall back on that, but I have also implemented
an addition to the stackless module that does the equivalent but
much faster (i.e. basically uses the interrupt to directly call
stackless.schedule()) Of course the interrupt only will switch when
the atomic flag is not set.

I am finding it pretty stable -- but you definitely do have to know
what you're doing to avoid wierdness...

Christian Tismer <tismer at tismer.com> writes:
> Another question: Why do you actually *want* to remove the
> current tasklet? I consider it suspicious, if not an error,
> when people think they want to do this.

Well... in my case I *was* using a channel for the same reason -- but
then there was a bug (which did get fixed :-) ) but I had removed the
channel for testing and just used .remove and .insert to "feed" the
tasklet.  So I guess I don't *need* to do it, but for some cases of
simple tasklets I can save a channel...(I don't have a good feel for
how much channels "weigh"...)

-- 
-Jas   --------------------     www.maya.com
       Jeff Senn          |   / / |-/ \ / /|®
       Chief Technologist |  /|/| |/ o | /-|
       Head of R&D        | Taming Complexity®

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



More information about the Stackless mailing list