Race condition in send_with_reply_and_block()

Havoc Pennington hp at pobox.com
Fri Jul 26 06:41:15 PDT 2013


This may be obvious, but an option available is to use libdbus from
only one thread, even though a program is multi-threaded. Some ways to
do that might be:

 1) use a separate DBusConnection in each thread (if this is broken, I
doubt it's for a difficult-to-fix reason)
 2) wrap DBusConnection in an abstraction which forwards all requests
to one dbus-dedicated thread, handles the requests, and then sends
back to the originating thread. You would assemble this out of some
sort of threadsafe queue abstraction presumably.

Nothing wrong with using GDBus, either.

Havoc


More information about the dbus mailing list