[Stackless] profile error, again

Kristján Valur Jónsson kristjan at ccpgames.com
Mon Jan 28 11:27:04 CET 2008

Okay, I've managed to simplify this a bit.

Run the attached program and watch stackless get confused.

The point is that I am fiddling with sys.setprofile() in the context switch callback.
I do this for a reason:  I assume that this is a global state, and I want to temporarily turn off profiling in this function because I am doing task switch bookkeeping for the profiler.

Let me repeat the issues that need solving:

1)      stackless shouldn't freak out at this.  Some frames are obviously being rescheduled or something.

2)      I need to be able to turn on profiling for all tasklets, as a global state, to snapshot a running program.

3)      the sys.setprofile() and stackless. set_schedule_callback do not return the previous value so it is impossible to temporarily set/unset them and then restore them.

For 2), I am thinking about adding a flag to stackless, stackless.tracing or something, to enable the old (thread) global behaviour.
For 3) I think the change should be straightforward.  I don't understand why sys.setprofile() isnt't this way already.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20080128/83afdbf1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: profcrash.py
Type: application/octet-stream
Size: 321 bytes
Desc: profcrash.py
URL: <http://www.stackless.com/pipermail/stackless/attachments/20080128/83afdbf1/attachment.obj>

More information about the Stackless mailing list