<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/102179/">http://git.reviewboard.kde.org/r/102179/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On August 12th, 2011, 3:45 a.m., <b>Dawit Alemayehu</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">#1. Doesn't this approach have similar issues to the one that forced me to change the previous QtConcurrent::run based implementation ? That is, doesn't the use of a single thread expose this function to lookup requests backlog and hence cause noticable delays ?
#2. Isn't all this complexity a bit too much for such a small functionality ? Wouldn't a much simpler approach work just as well ? For example,
- Keep the current look up thread, but connect its finished signal to its parent deleteLater signal in its ctor. [Automatic cleanup of the lookup thread].
- Make the lookup thread cache the looked up information in the global cache instead of storing it locally. [No need to store this inform 2x].
- Move all the preemtive lookup logic from the thread's run function to HostInfo::lookupHost. [No need to create a thread when DNS is already cached].
- Create the lookup thread on the heap and let it run until it finishes. When it is done it will clean itself up.
See a patch that implements the above approach at https://git.reviewboard.kde.org/r/102238/
</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">#1 Each request itself is threaded and non blocking, so i don't see why multiple request should cause delays
#2 Your patch has several issues i mentioned there</pre>
<br />
<p>- Albert</p>
<br />
<p>On August 11th, 2011, 10:10 p.m., Albert Astals Cid wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for kdelibs and Dawit Alemayehu.</div>
<div>By Albert Astals Cid.</div>
<p style="color: grey;"><i>Updated Aug. 11, 2011, 10:10 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Each time the terminate code triggers my Konqueror crashes, i'm substituting the terminate for just waiting the thread to finish and we just ignoring it.
The code has a race condition in which wait() returns false, then we switch to the thread and m_autoDelete is still not set and thus noone will delete the thread. I can add a mutex if you guys think this is unacceptable.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">When the
kDebug() << "Name look up for" << hostName << "failed";
if triggers i do not get a crash anymore.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>kio/kio/hostinfo.cpp <span style="color: grey">(344b1d8)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/102179/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>