<br><br><div class="gmail_quote">On Fri, Mar 8, 2013 at 5:21 PM, David Faure <span dir="ltr"><<a href="mailto:faure@kde.org" target="_blank">faure@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Debugging slowness in kmail showed me an issue there:<br>
<br>
209│ bool Nepomuk2::Resource::hasProperty( const QUrl& uri ) const<br>
210│ {<br>
211├>    determineFinalResourceData();<br>
212│     return m_data->hasProperty( uri );<br>
213│ }<br>
<br>
Even though we prepare the resource in a different thread (in<br>
asyncnepomukretriever) so all props are available, we're waiting on the<br>
ResourceManager mutex in that method, to read the properties.<br>
<br>
Ah, but determineUri() does nothing if m_uri is set (not empty), anyway.<br>
So how about the attached patch?<br></blockquote><div><br>Ship it!<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Note that I detected an error in the use of the "modification mutex" within<br>
Resource. I had used it only for "writes" to variables, but obviously the<br>
reads must be mutex-protected too. Now that I understand the C++11 memory<br>
model, it's a lot clearer :)<br>
I'll rename the mutex then, it's not a "modification mutex", it's a mutex for<br>
the resource member variables.<br></blockquote><div><br>Uhm. Okay.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Anyhow, please validate the URI thing -- am I right that it's empty initially,<br>
and then it's set (in determineUri()), and then never changed again?<br></blockquote><div><br>Yes. It's not always empty initially, sometimes it is provided in the constructor. But it is never changed again.<br><br>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
David Faure, <a href="mailto:faure@kde.org">faure@kde.org</a>, <a href="http://www.davidfaure.fr" target="_blank">http://www.davidfaure.fr</a><br>
Working on KDE, in particular KDE Frameworks 5<br>
</font></span><br>_______________________________________________<br>
Nepomuk mailing list<br>
<a href="mailto:Nepomuk@kde.org">Nepomuk@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/nepomuk" target="_blank">https://mail.kde.org/mailman/listinfo/nepomuk</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><span style="color:rgb(192,192,192)">Vishesh Handa</span><br>