[Panel-devel] Multithreaded krunner

Aaron J. Seigo aseigo at kde.org
Sun Nov 18 02:48:50 CET 2007


On Saturday 17 November 2007, Ryan Bitanga wrote:
> Here's the patch against the last time I svn up'd (r737082). Sorry for
> the delay, school kinda got in the way. And if I had only paid a
> little more attention to the threadweaver API, I could have avoided
> several unproductive days pinpointing the exact reasons for crashes
> and could've released this a week ago.

;)

> Interface:
> - Use threadweaver classes
> - Add a delay before updating matches so just in case multiple runners
> return results, the list only has to be updated once

that's nice =)

> Notes for writing future runners:
> - Use Plasma::SearchAction instead of QAction

and SearchAction is there because QAction is GUI and therefore not thread 
safe, correct?

> - Don't create QObjects that are children of objects from different
> threads (such as the runner)
> - Follow the others reminders in the Qt4 documentation about
> multithreading.
>
> Changes I snuck in:
> - change canBeConfigured() to isConfigurable() for the sake of API
> consistency

looks good. this part should be committed regardless.

> - add a whitelist to loadRunners() so users can selectively 
> load runner plug-ins in the future

please commit this part; thought this:


if( whitelist.empty() || !whitelist.empty() && whitelist.contains( 
service->name() ) )

could just be:

if (whitelist.isEmpty() || whitelist.contains(service->name()))

> Possible problems:
> - KRunner may not be responsive if the query is changed while the
> match method of a slow runner is being executed by threadweaver.
>   This is because ThreadWeaver doesn't abort jobs that are currently
> being run and aborting jobs requires the implementers of runners to
> have knowledge about ThreadWeaver jobs.

hm... how much and what kind of knowledge? because this probably isn't worth 
doing unless we can make the UI completely fluid.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071117/6bac1a99/attachment.pgp 


More information about the Panel-devel mailing list