[Kde-pim] Akonadi + multithreading

Kevin Krammer krammer at kde.org
Mon Mar 10 13:24:19 GMT 2014


On Monday, 2014-03-10, 11:47:23, Patrick Ohly wrote:
> On Fri, 2014-03-07 at 17:55 +0100, Kevin Krammer wrote:
> > On Friday, 2014-03-07, 16:40:09, Patrick Ohly wrote:
> > > If I move the check into the main thread, will the other Akonadi methods
> > > (in particular Job::exec) work in background threads?
> > 
> > Yes. All thread's have their own default session, i.e. the
> > Akonadi::Sesssion::defaultSession() instance is a "per-thread singleton".
> 
> Okay, I'll try it. One other potential pitfall is that the background
> thread creates the Akonadi::Collection which then later gets used for
> other operations in the main thread. But it sounds like that this
> shouldn't be a problem.

Right. Collection is a "value type" class, so as long as you are not modifying 
it from two threads it should be fine.

> > P.S.: great to hear from you again, despite the circumstances. We need to
> > invite you more often to our sprints :)
> 
> If you want to hear more from me, join the SyncEvolution mailing
> list ;-} There are obviously KDE users of the tool, just not many
> (none?) KDE developers involved.

I might do that :)

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- 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/20140310/48b47219/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