[PyKDE] Threading problem with PyQt4 and Macosx

Andreas Pakulat apaku at gmx.de
Wed Feb 21 22:10:53 GMT 2007


On 21.02.07 22:47:22, Michael Guntsche wrote:
> I recently started playing around with QThreads and Events/emits in pyqt4 
> (latest version) and I am facing some serious problems (hangs) now.
> I tried to keep the attached test very small.
> I have a textedit field that gets filed by QThreads.
> What happens is that if more threads get added while the program is running it 
> just locks (happens between 30-50 threads). I have to kill -9 it.
> This happens faster when removing threads. I had someone test this on an ubuntu 
> machine and he did not see the problem but I am still not sure if this is a 
> macosx only problem.
> I tried events as well and it locks up faster (less threads) with them.
> Am I doing something fundamentaly wrong here?

You forgot the .ui file for the dialog, but there's one thing I don't
understand: Why do you use a QMutex? You don't access any non-local data
between the lock and unlock so the mutex is useless.

Another thing you could do is add the QtCore.Qt.QueuedConnection
argument to the connect call. Although that should be used automatically
anyways.

Andreas

-- 
Your business will assume vast proportions.




More information about the PyQt mailing list