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

List:       kde-core-devel
Subject:    Re: Kded and DBus
From:       David Edmundson <david () davidedmundson ! co ! uk>
Date:       2013-01-03 18:09:25
Message-ID: CAGeFrHBXH22YsQHHaMkK9Q-ziyL=KbQQspxjd7y7ar_vQtV1GA () mail ! gmail ! com
[Download RAW message or body]

On Thu, Jan 3, 2013 at 4:43 PM, Daniel Nicoletti <dantti12@gmail.com> wrote:
> It's a known issue,  we ha random code running on the same thread..  A work
> around is to put the code on a thread,  and make sure all your call are non
> blocking.
> I'm planing on doing a prof of concept to change the way kded works to have
> this and other problems gone.
>
> Best
>
> Em 03/01/2013 14:14, "Cedric Bellegarde" <gnumdk@gmail.com> escreveu:
>
>> Hello,
>>
>> i'm kded-appmenu maintainer and i've got issues with Kded and DBus...
>>
>> When appmenu support is enabled, some applications hangs on startup: VLC,
>> Clementine.
>>
>> After some investigations,  and using clementine as an exemple, this is
>> happening:
>>
>> kded (kmix) do a DBus Introspection on clementine while clementine do a
>> DBus
>> Introspection on kded (appmenu).
>>
>> This make kded and the applications hangs for a while.
>>
>> Any idea to fix this ? Is this a kded limitation ? A DBus limitation ? Am
>> i
>> missing something ?
>>
>> regards,
>> --
>> Cédric

Always use async calls for everything

We had this lock between KTp and Amarok
https://bugs.kde.org/show_bug.cgi?id=310826 in exactly the same way.
Which is resolved now.

One problem is that
QDBusConnection::sessionBus().interface()->registeredServiceNames() is
a synchronous dbus call, which isn't easy to spot, and Qt has no async
alternative built in.

Mixer_MPRIS2::addAllRunningPlayersAndInitHotplug() uses this.


Fortunately one can recreate it asynchronously like so:

QDBusPendingCall async =
QDBusConnection::sessionBus().interface()->asyncCall(QLatin1String("ListNames"));
    QDBusPendingCallWatcher *callWatcher = new
QDBusPendingCallWatcher(async, this);
    connect(callWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
            this, SLOT(serviceNameFetchFinished(QDBusPendingCallWatcher*)));
[prev in list] [next in list] [prev in thread] [next in thread] 

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