Thread safety

Havoc Pennington hp at
Tue Sep 11 09:56:39 PDT 2007


On 9/11/07, Ross Burton <ross at> wrote:
> If I'm using DBus with the dbus-glib integration, how thread-safe is
> DBus?  Can I go as far as receiving a message in one thread and making
> the reply in another?  I'm expecting a thread pool to be used to handle
> method calls, so there will be a single thread accepting the messages
> but ten different threads sending the replies.

I would say this is supposed to work and probably works fine, at least
if by dbus-glib integration you mean only the setup_with_g_main().

If you're using the glib object system mapping in addition (DBusGProxy
etc.) then I don't know the latest status of that on thread safety,
but someone else can probably follow up and say.

You should probably be prepared to debug thread-related libdbus
issues, though for the simple case of just calling send() from another
thread, a number of other people already use it I think and I would
expect it to work.


More information about the dbus mailing list