[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Review Request: Do not terminate threads
From: "Dawit Alemayehu" <adawit () kde ! org>
Date: 2011-08-04 3:19:40
Message-ID: 20110804031940.25378.26310 () vidsolbach ! de
[Download RAW message or body]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102179/#review5369
-----------------------------------------------------------
I do not like this patch for the very reason you stated. I do not want the =
mutex there either because it is rather expensive. As it stands we start a =
thread for each lookup right now which in of itself is already too expensiv=
e for my taste. Hence, I will have to think of some other way to avoid the =
even worse solution of creating a local even loop. =
Having said that, are you using a slow DNS server ? The only way the looku=
p thread gets terminated is if your nameserver takes longer than 1000 ms pe=
r query. That is because the two KUriFilterPlugins that use it set a timeou=
t value of that duration. Otherwise, that code path should not be encounter=
ed at all!
- Dawit
On Aug. 2, 2011, 11:30 a.m., Albert Astals Cid wrote:
> =
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102179/
> -----------------------------------------------------------
> =
> (Updated Aug. 2, 2011, 11:30 a.m.)
> =
> =
> Review request for kdelibs and Dawit Alemayehu.
> =
> =
> Summary
> -------
> =
> Each time the terminate code triggers my Konqueror crashes, i'm substitut=
ing the terminate for just waiting the thread to finish and we just ignorin=
g it.
> =
> The code has a race condition in which wait() returns false, then we swit=
ch to the thread and m_autoDelete is still not set and thus noone will dele=
te the thread. I can add a mutex if you guys think this is unacceptable.
> =
> =
> Diffs
> -----
> =
> kio/kio/hostinfo.cpp fef39fc =
> =
> Diff: http://git.reviewboard.kde.org/r/102179/diff
> =
> =
> Testing
> -------
> =
> When the =
> kDebug() << "Name look up for" << hostName << "failed";
> if triggers i do not get a crash anymore.
> =
> =
> Thanks,
> =
> Albert
> =
>
[Attachment #3 (text/html)]
<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 />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I do not like this patch \
for the very reason you stated. I do not want the mutex there either because it is \
rather expensive. As it stands we start a thread for each lookup right now which in \
of itself is already too expensive for my taste. Hence, I will have to think of some \
other way to avoid the even worse solution of creating a local even loop.
Having said that, are you using a slow DNS server ? The only way the lookup thread \
gets terminated is if your nameserver takes longer than 1000 ms per query. That is \
because the two KUriFilterPlugins that use it set a timeout value of that duration. \
Otherwise, that code path should not be encountered at all!</pre> <br />
<p>- Dawit</p>
<br />
<p>On August 2nd, 2011, 11:30 a.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. 2, 2011, 11:30 a.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">(fef39fc)</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>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic