[PyQt] GUI freezing when running large function in QThread

Jason H scorp1us at yahoo.com
Tue Jul 21 02:05:01 BST 2009


This sounds like the GIL.
Separate the validation to another process, not another thread. Use non-blocking io (Qt's default) do get yoru GUI responsive again.

 



----- Original Message ----
From: Brent Villalobos <Brent.Villalobos at pdi.dreamworks.com>
To: "pyqt at riverbankcomputing.com" <pyqt at riverbankcomputing.com>
Sent: Monday, July 20, 2009 7:35:56 PM
Subject: [PyQt] GUI freezing when running large function in QThread

I'm trying to write a "validation" thread that will run persistently throughout my PyQt program and validate that user has entered the correct values in the fields.  The validation thread calls a function in a separate python module that shouldn't know anything about PyQt since it is a general-purpose module that runs in both gui and non-gui applications.  The problem is that my GUI slows way down where actions like mouse clicks aren't recognized until the validation function finishes.  The validation function is doing some mild CPU and I/O work, but nothing that peaks out the processor or disk.  Unfortunately I don't have a simple case to show at this time, but perhaps people have run into a similar issue in past.  Anyone have any suggestions how I can make a function that runs in a QThread more "gui-friendly" without adding any Qt-specific calls to it?  Thanks.
_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt



      


More information about the PyQt mailing list