While running outside of the Pydevd debugger, my multithreaded (Using threading.Thread) application works without any hiccups. As soon as I run within the debugger, certain threads exhibit odd behavior and tend to lock up after a short period of time.
There's two behaviors that I'm not understanding here:
1. Pydevd seems to be unable to suspend certain threads. I can't see why though. Some threads suspend reliably, some don't.
2. One thread in particular (Using asyncore) seems to be the big trouble maker. Within the asyncore.poll() function (At randomly varying locations), the thread locks up while running in the debugger.
Since this looks like a conflict between my threads and the pydevd debugger, I'm at a loss to know how I would debug the root cause of this problem. Without being able to run the application in the debugger, it's pretty difficult to debug anything.
Any tips on how to debug the debugger? Or is this a known issue with asyncore and PyDev?
Which python version are you using?
I removed asyncore from the design in place of simple UDP socket I/O. I found that the debugger exhibits the same behavior in freezing my I/O thread as it did when the I/O thread was asyncore based. It appears that socket I/O doesn't cooperate very well with the PyDev debugger when the socket is threaded and receives data (PyDev 1.6.5). Endless searches on the web have not yeilded any clues as to why though.
Moving the socket I/O into the main thread seems to have cured the problem. But that doesn't extend well into larger multi-socket programming under PyDev.
I'm forced to use Python 2.4.3 because of an overly draconian configuration management process.
Well, version 2.4 is known to have problems… you can try to improve on that situation by installing the threadframe extension (http://pypi.python.org/pypi/threadframe).