[Stackless] tracing Stackless events
David Wyand
TheHeadGnome at gnometech.com
Thu Dec 20 16:43:16 CET 2007
Hi Andrew.
> - I can't figure out how to get all tasklets in the system, so I
> only get
> all the ones which are "named" in my WeakKeyDict
>
> Possible solution: tell me how to do that. Failing that, implement a
> function which iterates over all tasklets.
>
I also needed to get a list of all tasklets in the system for my Stackless
and Twisted example (http://www.gnometech.com/pythonproducts.shtml). I
couldn't find a way to do it directly so I ended up using the gc to build a
list. If you look in the zone.py file in my example under the
GetTaskletsForWeb() method you'll see how I accomplished this. I also have
a custom Tasklet class and that's where the 'context' and 'parentObj'
attributes come from in the list generation.
The main downside is the performance hit I take while working with the gc.
There is a noticeable pause in my event loop while performing a manual
gc.collect() and getting the object list.
I agree that it would be handy to obtain a list of tasklets directly from
Stackless. It has helped me in the past with real-time debugging. Maybe
Richard could let us in on how Eve does this, if at all.
- Dave
More information about the Stackless
mailing list