R
ruby-lang
How do I get a backtrace of another (possibly running) Thread?
I want to get an idea of what is blocking in other threads, and
therefore want to periodically dump a list of threads with their
backtraces to get a feeling what they're up to.
Ideas which did not work:
- begin
otherThread.raise("Gotcha!")
rescue RuntimeError
<do an eval in the otherThread (but how?)>
otherThread.resume
end
...raises the exception in otherThread, not the calling thread.
- Kernel.set_trace_func() .
...doesn't seem to keep track of Threads(?).
...doesn't say on which function it is blocking.
Regards,
Rutger.
I want to get an idea of what is blocking in other threads, and
therefore want to periodically dump a list of threads with their
backtraces to get a feeling what they're up to.
Ideas which did not work:
- begin
otherThread.raise("Gotcha!")
rescue RuntimeError
<do an eval in the otherThread (but how?)>
otherThread.resume
end
...raises the exception in otherThread, not the calling thread.
- Kernel.set_trace_func() .
...doesn't seem to keep track of Threads(?).
...doesn't say on which function it is blocking.
Regards,
Rutger.