<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Right... with a main loop, the wakeup_main() function is supposed to<br>solve this. Since there&#39;s no way to wake up read_write(), it&#39;s not
<br>helpful to set a wakeup function in the no-main-loop case.<br><br>As you say the solution would be to add a pipe that read_write() also<br>selects on. This is how g_main_context_wakeup() works with the GLib main<br>loop.
<br><br>Hmm. Well, for now I guess any app beyond simple command line apps just<br>has to use a full main loop.</blockquote><div><br>Still trying to wrap my head around the problem (I&#39;m a bit slow some days :).&nbsp; The analogue to using read_write_dispatch is to use set_watch_functions, select&#39;ing on the fds of any active watches, and calling 
<a class="el" href="http://dbus.freedesktop.org/doc/dbus/api/html/group__DBusWatch.html#gc2acdb1794450ac01a43ec4c3e07ebf7">dbus_watch_handle</a> on any handles that have associated file descriptors that come back from the select.&nbsp; So, the issue is that, although the callbacks registered with set_watch_functions are modifying whatever data structure the read_write_dispatch calls, read_write_dispatch never leaves its select, and will thus never be aware of function calls being done.&nbsp; Right?&nbsp; So, in my program I need to have the set_watch_function callbacks put a little data in a pipe that the selecting thread is monitoring so that it refreshes the data structure containing the watches.&nbsp; 
<br><br>As a more concrete question, does dbus_connection_send_with_reply trigger the AddWatchFunction callback with a DBusWatch object that needs servicing in order for the dbus function call to be initiated, or does it work some other way?
<br> </div></div>