[Stackless] Hidden cycles Re: Stackless Digest, Vol 23, Issue 3

Christian Tismer tismer at stackless.com
Thu Dec 15 11:23:41 CET 2005


Andrew Francis wrote:

<snip>

> I am interested in coming up with generalised code
> that
> in a "debugger" mode will "dump" the channels and the
> tasks.

Should not be that difficult to do.
You can derive from channels and tasklets.
And for some other application, I wanted to debug stuff
without changing my code, and also to add different
scheduling stratieds.
So I made new versions of channels and tasklets by deriving,
and then patched them into the stackless module at runtime.
Easy and works quite fine. Just make sure that your patching
code is run prior to any imports of the module.

> Perhaps it would be nice if a BlockedTasklet exception
> could be
> raised, if there are blocked tasklets after
> stackless.run() is
> exited. Or is this what TaskletExit suppose to be?

TaskletExit is just a subclass of SystemExit, which is
meant to terminate a tasklet without promoting an
exception.

No, I think in this case it would be best to keep track
of all channels and check if they are empty after run().

I think we can make things easier by thinking of a construct
that allows to wait on more than one channel at a time.
This can probably be written on top of the builtin stuff.
It needs a bit of abstraction, of course.

ciao - chris
-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
tismerysoft GmbH             :     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 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
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 stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list