Race condition with dbus_connection_send_with_reply()?

Havoc Pennington havoc.pennington at gmail.com
Tue Mar 3 23:33:08 PST 2009


Hi,

http://bugs.freedesktop.org/show_bug.cgi?id=19796
http://bugs.freedesktop.org/show_bug.cgi?id=857
http://lists.freedesktop.org/archives/dbus/2007-December/009082.html

DBusPendingCall was created with a main loop in mind, the assumption
being people would use dbus_connection_send_with_reply_and_block()
with threads. But blocking with threads apparently has some issues
also. Someone needs to figure it out. I would start by getting some
decent test coverage on threaded dbus usage and/or running helgrind,
and then also thinking conceptually how it should work of course.

DBusPendingCall has some conceptual problems with threads because the
notifier function would always be called from the
connection-dispatching thread not the method-calling thread.

In general I'm not sure it's sane to do much in threads besides block
for replies, because dispatching can only happen in one thread, and
dispatching and blocking are about the only two things the connection
does anyway.

Havoc


More information about the dbus mailing list