OK so I'm writing a program in PyQT (Qt3.3), and I've got a stickler of a problem. I'll try to be brief: basically I have a thread that programs some hardware over a range of values (just a sweep type of thing), and at each value, I collect some information, and pass it back to the main event thread for handling.
The handling is a little involved, requires querying a backend over a socket, searching an internal dictionary or two for matching results, updating an on screen table and possible updating the display in a little modal dialog. There aren't any heavy duty calculations going on.
Originally, I was polling the hardware up to 16x/second and sending each response through a custom event to the main gui for handling. This was breaking things (described below), so I switched to dumping the responses into a list (wrapped in a mutex), and then sending a single event if there was anything the GUI needed to handle (instead of getting the data from the event, the GUI now gets it by popping results off the list).
At any rate, both these techniques result in one thing: my event queue dies. There's no exceptions/errors/segfaults or anything, it simply stops processing. I can see that the scanning thread is still active (it still prints out and everything), but the main gui is just dead, no repaint or anything. I even put a QTimer with a zero timeout in that just prints "Event queue is idle!" and sure enough, it stops printing, confirming that the event queue is dead.
So my question is, has anyone seen this kind of behavior? Is it possible to destroy the event queue by having too complex of an event handler? This is a real stumper for me, especially since the data being sent back to the main GUI on each event is < 64 bytes.
Bookmarks