[Stackless] unexpected tasklet & channel behaviour

Richard Tew richard.m.tew at gmail.com
Wed Nov 1 08:35:59 CET 2006


On 11/1/06, ardatur at mail.ru <ardatur at mail.ru> wrote:
> AFAICS there are 2 problems here:
> 1) why is `6 b' ever printed?

The only reference to the channel is inline, and when it
garbage collected the tasklets on it will be unblocked
and I believe considered equivalent to tasklets that
have been partially run and chosen to yield part
way through (perhaps calling schedule).

Because f2 holds a local reference to the channel, the
tasklets on it do not get unblocked and any attempt to
manually run them fails, as it should.

> 2) looks like `t1.run()' in the case 4 runs both t1 and t2, which
> results in a `t2.run()' failure.

Yes.  This is something that confused me too.  Doing tasklet.run
does not just run that tasklet.  It runs that tasklet and then all the
other scheduled tasklets after it the chain are run next, then it
exits.

No real bugs here.  Just unexpected ways things work :)

Richard.

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



More information about the Stackless mailing list