[Qt-interest] Immortal Programs!
Thiago Macieira
thiago.macieira at trolltech.com
Thu Jul 2 17:13:32 CEST 2009
Em Quinta-feira 02 Julho 2009, às 17:04:35, Gary Coulbourne escreveu:
> Oliver.Knoll at comit.ch wrote:
> > Gary Coulbourne wrote on Thursday, July 02, 2009 12:10 AM:
> >> ...
> >> I cannot find anything in the documentation to explain this
> >> behaviour,
> >
> > That's all about multithreaded programming, how to properly terminate
> > threads when your app needs to terminate.
>
> I assumed that it was because there were still threads running -- however,
> Qt doesn't appear to provide a way to enumerate the threads that
> QNetworkManager created.
That's because it creates none.
> I'm not directly creating the threads, they're daemons that, as far as I
> can tell, appear to be spawned by either the networking code or the xml
> parsing code inside of Qt. I can set a boolean and have the slots in my
> code that get called throw an exception in that condition or a false to
> indicate an error (since I'm using the streaming xml processor...)
There's only one extra thread that Qt creates when doing behind-the-scenes
work, which is the QHostInfo thread, used to resolve hostname asynchronously.
Qt takes care of shutting that thread down properly when the application is
quitting. However, since we don't control the system host-name resolution
routines, if those are blocked, there's nothing we can do.
Usually, they time out after 30 seconds or one minute. But if that's the case,
you should fix your DNS server and/or configuration (/etc/resolv.conf on Unix).
--
Thiago Macieira - thiago.macieira (AT) nokia.com
Senior Product Manager - Nokia, Qt Software
Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090702/03fd8338/attachment.bin
More information about the Qt-interest-old
mailing list