Review Request: Replace thread usage with local event loop in kio/kio/hostinfo.cpp
thiago at kde.org
Tue Aug 9 07:50:36 BST 2011
On Tuesday, 9 de August de 2011 00:33:46 David Faure wrote:
> No no, I call wait after *terminate* ! Terminate is "almost instant
> termination", it kills the thread. So this does not wait for the DNS lookup
> to be finished, it only waits for terminate to call the cleanup callback,
> which should be almost instant (it's just that it's in another thread).
> I admit that I didn't fully test the case of a very slow DNS, but quick
> testing on the flaky network here seemed ok, and until someone proves the
> contrary, I firmly believe that this does not block for the whole duration
> of the dns lookup. If it did, it would mean that terminate would basically
> do nothing ;)
> And no, we definitely want no nested event loop. Anything else, but not
And anything but terminate, please. Nested event loops are better than a
thread cancellation through unprotected code.
If you call terminate, all bets are lost. The first time you call terminate, I
will wash my hands of ANY bug you find afterwards in QtNetwork.
Don't terminate the thread -- just let it exit on its own, even if it will
take 30 minutes.
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 190 bytes
Desc: This is a digitally signed message part.
More information about the kde-core-devel