-
Folks: Thanks for the library! I'm using a custom action to generate a "transcript" of a running computation, for subsequent analysis. Everything's going well, except that my action is only being called for functions in my main thread. Setting Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yeah that is exactly the problem. I went the safe way and didn't mess with trace hooks in live threads, cause I'd have to mess various thread internals to figure out what threads are running and patch their threadstate, and internals seems to change every python release. It was hard enough figuring out how to support python 3.11 (cause I did use some internals) so I'm not keen on the idea of using internals, not anymore, sorry :/ But one thing that could work is starting the trace inside your thread (instead of the main thread). That should get tracing active for that one thread. |
Beta Was this translation helpful? Give feedback.
Yeah that is exactly the problem. I went the safe way and didn't mess with trace hooks in live threads, cause I'd have to mess various thread internals to figure out what threads are running and patch their threadstate, and internals seems to change every python release. It was hard enough figuring out how to support python 3.11 (cause I did use some internals) so I'm not keen on the idea of using internals, not anymore, sorry :/
But one thing that could work is starting the trace inside your thread (instead of the main thread). That should get tracing active for that one thread.