[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-frameworks-devel
Subject:    Re: Review Request 118614: Make KIO thread-safe
From:       "Kevin Ottens" <ervin () kde ! org>
Date:       2014-06-14 10:39:14
Message-ID: 20140614103914.5132.48411 () probe ! kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118614/#review60077
-----------------------------------------------------------

Ship it!


Would have never guessed it required so little adjustments. That's great!
Definitely a go IMO.

As for KDBusConnectionPool it's fine to use it I think. As you pointed out it'll be \
easy to switch later on if QTBUG-39528 gets addressed.

- Kevin Ottens


On June 8, 2014, 10:11 a.m., David Faure wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118614/
> -----------------------------------------------------------
> 
> (Updated June 8, 2014, 10:11 a.m.)
> 
> 
> Review request for KDE Frameworks, Aleix Pol Gonzalez and Thiago Macieira.
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> Unittest for kiocore's thread-safety
> 
> 
> KIO thread safety: use one DBus connection per thread
> 
> 
> KIO thread safety: don't use static buffers.
> 
> They obviously lead to data races between threads.
> 
> KIO: create one instance of Scheduler per thread.
> 
> 
> Diffs
> -----
> 
> src/core/scheduler.cpp e762e369b8d74971831dc1e9f4d083bfd77b8e30 
> src/core/connectionbackend.cpp 532141af5ab7676d1287379e56ff48bd7fa10c37 
> autotests/threadtest.cpp PRE-CREATION 
> autotests/CMakeLists.txt 81d261b8620e0a0512a5bc021ed189e910c0922a 
> 
> Diff: https://git.reviewboard.kde.org/r/118614/diff/
> 
> 
> Testing
> -------
> 
> helgrind'ing the unittest.
> 
> I found and fixed many races within Qt by doing that...
> Race on QMutex::id --> https://codereview.qt-project.org/86237
> Race in QThreadStorage --> https://codereview.qt-project.org/87047
> Race in QLoggingCategory --> https://codereview.qt-project.org/87054
> 
> Also reported QTBUG-39528 (QDBusConnection::sessionBus race)  (but we have \
> KDBusConnectionPool for that) 
> And there are still more races in Qt: 
> QMutex::isRecursive, qdbus_loadLibDBus, QDBusConnectionPrivate::connectSignal, \
> qt_message_print.... 
> And a few in our code:
> the getenv(KDE_FORK_SLAVES) in KIO, and the dbus interface for klauncher in \
> KDEInitInterface::ensureKdeinitRunning. 
> 
> Thanks,
> 
> David Faure
> 
> 


[Attachment #5 (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="https://git.reviewboard.kde.org/r/118614/">https://git.reviewboard.kde.org/r/118614/</a>
  </td>
    </tr>
   </table>
   <br />



 <p>Ship it!</p>



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Would have never guessed \
it required so little adjustments. That&#39;s great! Definitely a go IMO.

As for KDBusConnectionPool it&#39;s fine to use it I think. As you pointed out \
it&#39;ll be easy to switch later on if QTBUG-39528 gets addressed.</pre>  <br />









<p>- Kevin Ottens</p>


<br />
<p>On June 8th, 2014, 10:11 a.m. UTC, David Faure wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for KDE Frameworks, Aleix Pol Gonzalez and Thiago Macieira.</div>
<div>By David Faure.</div>


<p style="color: grey;"><i>Updated June 8, 2014, 10:11 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kio
</div>


<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;">Unittest for kiocore&#39;s thread-safety


KIO thread safety: use one DBus connection per thread


KIO thread safety: don&#39;t use static buffers.

They obviously lead to data races between threads.

KIO: create one instance of Scheduler per thread.</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;">helgrind&#39;ing the unittest.

I found and fixed many races within Qt by doing that...
Race on QMutex::id --&gt; https://codereview.qt-project.org/86237
Race in QThreadStorage --&gt; https://codereview.qt-project.org/87047
Race in QLoggingCategory --&gt; https://codereview.qt-project.org/87054

Also reported QTBUG-39528 (QDBusConnection::sessionBus race)  (but we have \
KDBusConnectionPool for that)

And there are still more races in Qt: 
QMutex::isRecursive, qdbus_loadLibDBus, QDBusConnectionPrivate::connectSignal, \
qt_message_print....

And a few in our code:
the getenv(KDE_FORK_SLAVES) in KIO, and the dbus interface for klauncher in \
KDEInitInterface::ensureKdeinitRunning.</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>src/core/scheduler.cpp <span style="color: \
grey">(e762e369b8d74971831dc1e9f4d083bfd77b8e30)</span></li>

 <li>src/core/connectionbackend.cpp <span style="color: \
grey">(532141af5ab7676d1287379e56ff48bd7fa10c37)</span></li>

 <li>autotests/threadtest.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>autotests/CMakeLists.txt <span style="color: \
grey">(81d261b8620e0a0512a5bc021ed189e910c0922a)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/118614/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic