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

List:       kde-pim
Subject:    [Kde-pim] Thread-safety of Nepomuk::Resource[Data|Watcher]
From:       Volker Krause <vkrause () kde ! org>
Date:       2012-03-10 10:51:17
Message-ID: 2307986.mh3UV3I8y3 () vkpc9
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


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


["signature.asc" (application/pgp-signature)]

_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/

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

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