[Python-Dev] cProfile and threads (original) (raw)
GrosBedo grosbedo at gmail.com
Wed Sep 8 23:09:43 CEST 2010
- Previous message: [Python-Dev] cProfile and threads
- Next message: [Python-Dev] cProfile and threads
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
Ive just stumbled accross your changes Krisvale, and from your last reply, I can see that you invalidated your changes :
I just realized that this is probably a redundant change.
We have C apis to get all the Thread states in an interpreter state (I didn't even know there was such a thing as multiple interpreter states, but there!) This is the PyInterpreterStateThreadHead() api et al. From C, all that is missing is a SetTrace api that takes a thread state.
From python, the threading module provides access to all Thread objects, and each of those has a settrace/setprofile method. To turn on global tracing from cProfile, all that is needed is to iterate over all the Thread objects. Setting this to invalid, since there already are APIs to do this, at least from .py code. Could you please provide more explanations, or even an example ? Because it seems that you're the only one on earth to finally find a way to multithread the cProfiler... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20100908/4d64768e/attachment.html>
- Previous message: [Python-Dev] cProfile and threads
- Next message: [Python-Dev] cProfile and threads
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]