This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients fijall, pitrou, serhiy.storchaka, vstinner
Date 2016-02-29.23:31:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1456788712.59.0.629550157005.issue26461@psf.upfronthosting.co.za>
In-reply-to
Content
fijal explained on IRC his use case: implement vmprof on Windows, a statistical profiler, using a C thread running in the Python process.

The _PyThread_CurrentFrames() API requires to be called with the GIL hold which is not acceptable for his use case. Having to wait for the GIL would serialize statistics plots and so would have a poor quality, probably similar to cProfile.

The use case is to implement something like _PyThread_CurrentFrames() without holding the GIL.

--

fijal mentioned pystate.c/.h functions which come with this comment:

/* Routines for advanced debuggers, requested by David Beazley.
   Don't use unless you know what you are doing! */

These functions are not safe if you don't hold head_mutex lock, but this lock is private in pystate.c (declared with "static").

I guess that they are safe to use if the whole process is stopped by a debugger like gdb.
History
Date User Action Args
2016-02-29 23:31:52vstinnersetrecipients: + vstinner, pitrou, fijall, serhiy.storchaka
2016-02-29 23:31:52vstinnersetmessageid: <1456788712.59.0.629550157005.issue26461@psf.upfronthosting.co.za>
2016-02-29 23:31:52vstinnerlinkissue26461 messages
2016-02-29 23:31:52vstinnercreate