Fwd: Circular calls with DBUS
Thiago Macieira
thiago at kde.org
Mon Mar 26 15:19:38 PDT 2007
Rob Taylor wrote:
>> The bindings switched away from the "BlockWithGui" mode as the default
>> before they were released with Qt 4.2. So, the default calling mode is
>> a fully-blocking call (using
>> dbus_connection_send_with_reply_and_block).
>
>OOI, why did you switch away from using BlockWithGui by default?
Because "spinning the event loop is evil". We learnt that in KDE 3 and Qt
3 code: it causes too many unexpected events to happen (deferred object
deletions, socket input, other message deliveries, etc.).
As a rule of thumb, you're not supposed to re-start the event loop in a
Qt-based application unless you have a pretty good reason for that. Most
of the API that is asynchronous and needs to deal with synchronous calls
(like QTcpSocket and QProcess) have waitFor* methods.
Right now, the QtDBus API is an exception in that it's synchronous by
default.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20070327/3bd9177a/attachment.pgp
More information about the dbus
mailing list