[PyQt] Signals across threads is slow
romain at peerfuse.org
Mon Dec 8 10:22:11 GMT 2008
In a PyQT program, there is two classes, one derived from QThread, and one in
the main GUI thread.
A slot of the GUI thread's class is connected to a QThread signal, and it
seems that this is very slow to emit signal and/or call slot. This result
happens with an empty slot method too.
The hotshot profiler confirms that, the main thread is in the empty slot 70% of
time (and is called only 16 times).
# get some data from socket
def __init__(self, client):
self.thread = UDPStreamingThread()
self.connect(self.thread, SIGNAL('messageReceived'), self.messageReceived)
def messageReceived(self, data):
Romain Bignon -- http://romain.peerfuse.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20081208/84e17b15/attachment.bin
More information about the PyQt