Kristján Valur Jónsson <krist...@ccpgames.com> added the comment:

Here is a new patch.  When 'allthreads' is specified to 
cProfile.Profile.enable(), profling is enabled on all threads.
The testsuite tests to see that all threads do indeed register, it does not 
attempt to validate the timings.

It turns it on for all threads (in all interpreter states).  Maybe this is 
overdoing it.  Interpreter states is something new to me, a py3k feature?

Now, the problem with this approach is that it only works with threads already 
in existence when called.  The "global" appcoach that we used to solve a 
similar problem in Stackless Python, however, will invoke the tracing/profiling 
functionality for all tasklets, even if they were new.  The same would be 
useful for threads in regular python, especially in long running server 
applications.

However, this patch stands on its own.  This particular shortcoming could be 
fixed later.

----------
Added file: http://bugs.python.org/file18813/cprofile2.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9609>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to