[Kde-pim] Thread-safety of Nepomuk::Resource[Data|Watcher]

Volker Krause vkrause at kde.org
Sat Mar 10 10:51:17 GMT 2012


Hi,

I'm debugging a very frequent KMail crash I'm seeing since a few days, related 
to usage of Nepomuk from multiple threads (code is here: 
kdepim/messagecore/asyncnepomukresourceretriever.cpp). If it's because of 
recent changes in Nepomuk or due to the fact that I now have a production-size 
Nepomuk database with the Akonadi feeder finally working, I don't really know, 
but I think I found the cause :)

Nepomuk::Resource is documented to be thread-safe, and the implementation 
looks like great care has been taken to ensure it really is. Same for 
ResourceData. Not so ResourceWatcher, it has no internal locks and it uses a 
D-Bus connection bound to the main thread. Since mid-January ResourceData uses 
ResourceWatcher internally though, effectively breaking the thread-safety 
guarantee of Resource.

I have now commented out the ResourceWatcher usage in ResourceData locally, no 
more crashes so far, which seems to confirm the analysis above.

How do we fix this best? Moving the ResourceWatcher instance to the main 
thread and using queued connections to communicate with it in both directions?

regards,
Volker

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20120310/49635d2b/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list