A libev based mainloop and lost signals

Thomas Themel thomas at themel.com
Wed Aug 11 06:48:05 PDT 2010

Excerpts from Thiago Macieira's message of Tue Aug 10 14:30:30 +0200 2010:
> To make this work, you must not use _and_block. You must instead use 
> send_with_reply and make sure that the other thread doesn't pull your reply 
> before you do.

Well, send_with_reply is not an overly nice API for a multithreaded setup since
I have a race between setting the DBusPendingCall's callback and the
dispatching of the reply in the background thread. 

I'm also a little confused since the DBusConnection docs state

 * The most useful function to call from multiple threads at once
 * is dbus_connection_send_with_reply_and_block(). That is,
 * multiple threads can make method calls at the same time.

So, how would this be true if the _and_block took control of the socket in EACH
thread and the multiple waiters discarded each others' responses?

[*Thomas  Themel*]  "Das einzig wirklich gefaehrliche Tool
[extended contact]  sitzt jedoch zwischen den Ohren und
[info provided in]  vor dem Bildschirm."
[*message header*]  - Kristian Koehntopp über "Hackertools"

More information about the dbus mailing list