[Panel-devel] KRunner multithreading

Ryan Bitanga ephebiphobic at gmail.com
Mon Nov 12 05:59:28 CET 2007


On 11/10/07, Aaron J. Seigo <aseigo at kde.org> wrote:
> On Friday 09 November 2007, Ryan Bitanga wrote:
> > Just thought I'd let everyone know that I'm almost finish working on
> > multithreading for KRunner.
>
> woah; that's surprising, but good, news ...
>
> > Majority of the work is done in
> > interface.cpp but I had to make SearchContext thread-safe. Anyways,
>
> feel free to post patches if you'd like some review / other pairs of eyes on
> the code.
>
> > there are a few bugs left and I'm still figuring how to make it work
> > _faster_ because somehow it got _slower_ despite using multiple
> > threads. :-/
>
> well, threading doesn't really make things faster .. it just makes things not
> get in the way of each other =) that said, perhaps there's some blocking
> issues (e.g. issues with concurrent access to SearchContext?)

Well, theoretically, it should scale better when run on SMP or
multicore systems because code is run in parallel but i think the
mutex locking and unlocking takes its toll on the performance.

It's been more difficult than I had expected. I had problems with
SearchAction being a QObject and living in another short-lived thread,
so I had to remove the dependence on QAction and reimplemented the
isEnabled, icon, data, and text methods (which were currently the only
methods from QAction that are used in runners) in SearchAction itself.

Anyways, I'm having issues with setting SearchContext::Type in another
thread because sometimes I get random crashes in KUriFilter, although
sometimes it works perfectly. I'm also having issues with ThreadWeaver
causing crashes when the query changes too fast. I'm testing various
solutions to both but I haven't quite found the optimal solution.

Hopefully I'll have something to show within the day.

Cheers,
Ryan


More information about the Panel-devel mailing list