Debugging threaded Python code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Derek Thomson

    #1

    Debugging threaded Python code

    Hi,

    I frequently have to debug some fairly tricky Python multi-threaded
    code, and I need some help using the debugger to help me diagnose the
    problems when they occur. Yes, I know that the best option with threaded
    code that is problematic is to rewrite it, but that's not really an
    option that I have (right now).

    What would really help me is to be able to see a list of all the
    currently active threads, and the Python stack trace for each. At least
    then I could see where the failures are happening - deadlocks in
    particular. I have to spend a lot of time right now just to reach that
    point.

    I spent some time trying to achieve this with the Python debugger and
    couldn't. This has been bugging me for quite a while now, and I'm
    probably just missing the obvious as usual. Is there some simple way I
    can do this?

    Thanks,
    Derek.
Working...