[Stackless] "prev" in schedule_callback is never 'alive'?

Andrew Dalke dalke at dalkescientific.com
Tue Dec 18 00:52:52 CET 2007

I've been experimenting with set_schedule_callback.  The callback  
function get

         set_schedule_callback(callable) -- install a callback for  
         Every explicit or implicit schedule will call the callback  
           def schedule_cb(prev, next):
         When a tasklet is dying, next is None.
         When main starts up or after death, prev is None.
         Pass None to switch monitoring off again.

If I look at the "prev" object, it is always dead, and I don't see a  
frame.  Why is that?

The relevant code is in module/scheduling.c lines 812 and onward

         NOTIFY_SCHEDULE(prev, next, NULL);

         ts->st.ticker = ts->st.interval;
         prev->recursion_depth = ts->recursion_depth;
         prev->f.frame = ts->frame;

I don't know the consequences of moving that frame assignment to  

I would like to know the frame so I can report stack information as  
part of my trace.  As a simple example, to report the file/line number.

				dalke at dalkescientific.com

More information about the Stackless mailing list