Re-entrancy of QtDBus Bindings

Thiago Macieira thiago at kde.org
Tue Mar 6 06:58:14 PST 2012


On terça-feira, 6 de março de 2012 10.14.32, Ogden, Nick wrote:
> Is anyone able to confirm that QDBusAbstractInterface::call() is re-entrant
> by the Qt definition of re-entrancy?

Yes, it is, as per Qt's definition of reentrant: it's fine to use it in different 
threads at the same time, provided you use it in different objects.

If you reenter in the same thread (because you made a call with 
QDBus::BlockWithGui and you received a call or a signal while waiting for the 
reply), it should not crash. But it's something I've never tested.

> "a class is said to be reentrant if its member functions can be called
> safely from multiple threads, as long as each thread uses a different
> instance of the class."
> 
> Which, if combined with the later stated:
> 
> "If a class is not marked as thread-safe or reentrant then a specific
> instance of that class should not be accessed from different threads."

Sorry, that is not accurate for this class. The class is reentrant from 
different threads. Reentrancy in the same thread is not tested but I don't see 
why it might crash or anything.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      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: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20120306/1dc65df8/attachment.pgp>


More information about the dbus mailing list