From freedesktop-dbus Fri Dec 28 00:26:50 2007 From: Thiago Macieira Date: Fri, 28 Dec 2007 00:26:50 +0000 To: freedesktop-dbus Subject: Re: Proper use of dbus_connection_send_with_reply & DBusPendingCall Message-Id: <200712272226.51299.thiago () kde ! org> X-MARC-Message: https://marc.info/?l=freedesktop-dbus&m=119880163030345 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0236265839==" --===============0236265839== Content-Type: multipart/signed; boundary="nextPart2872972.t6Fyzc7FVT"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2872972.t6Fyzc7FVT Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline David Belser wrote: >1 - I will be handling the reply in a different thread than the one >that made the call, this may or may not be that big of an issue >depending on how and what my app is doing. > >2 - There is a brief window where the dispatch thread may receive the >reply before I've set the callback notify function. There's a simple solution to both cases: only access the DBusConnection=20 from one thread. Your application can be multi-threaded, but you don't=20 have to make concurrent accesses to the DBusConnection object. Since you're talking about a binding, it shouldn't be too difficult to=20 wrap those concepts. However, there is also a drawback: the dispatching thread has to be=20 available. Either it's a dedicated thread for that job or it's a thread=20 that you guarantee not to block on expensive operations. If it's not a=20 dedicated thread, you have to worry about deadlocks as well (dipatching=20 thread calls aux thread that tries to access D-Bus). =2D-=20 =A0 Thiago Macieira =A0- =A0thiago (AT) macieira.info - thiago (AT) kde.org =A0 =A0 PGP/GPG: 0x6EF45358; fingerprint: =A0 =A0 E067 918B B660 DBD1 105C =A0966C 33F5 F005 6EF4 5358 --nextPart2872972.t6Fyzc7FVT Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHdELLM/XwBW70U1gRAgmhAJ9loEaK7BukX1SVH+B67H5bx4aOhACgi5/B H6HVSGS1mI82XeXBsGdNrQ4= =W9pA -----END PGP SIGNATURE----- --nextPart2872972.t6Fyzc7FVT-- --===============0236265839== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dbus mailing list dbus@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dbus --===============0236265839==--