[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Aplication frozen when waiting response from connections
From: David Boddie <david () boddie ! org ! uk>
Date: 2007-06-21 22:59:17
Message-ID: 200706220059.18559.david () boddie ! org ! uk
[Download RAW message or body]
On Mon, 18 Jun 2007 22:50:31 -0300, Reinaldo Carvalho wrote:
> I working in a program to manage cyrus and ldap accounts using pytq,
> and this program as frozen when wait for response of ldap searchs or
> listing cyrus mailboxes on bigger databases, and go back normal when
> received responses. I think this is normal beacause i insert actions
> directly when pushbutton as clicked.
Yes, there's only one thread, and any blocking operation will cause
the rest of the application to wait until it is finished.
> I think that starting a function as a thread the main window dont
> fronzen when waiting for resonses os servers connections. But i dont
> know do this.
If you are using Twisted for your networking code, there may be a way to
do this without threads since there is apparently a way to mix Twisted's
event model with the one used by PyQt, though maybe this only works
with non-blocking operations.
If you can use non-blocking network communication, you could even just run
PyQt's event loop periodically yourself by calling qApp.processEvents().
There are three threading examples in the PyQt4 distribution that have been
ported from C++ (look in the examples/threads directory). You might want to
take a look at them to get an idea of what you can do with threads.
David
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic