About dbus watch functions

Weng Xuetian wengxt at gmail.com
Mon Jul 11 00:48:38 PDT 2011


Hi,
I'd like to use simplest select() to write a multi-thread dbus program. 
It has multi event source (including dbus), all event will be processed 
under their own thread, and all thread might send dbus message out. I 
have explored a little and it seems that DBusWatch is something that I 
want. But I have some questions about dbus_connection_set_watch_functions.

 From the dbus code, add_function and other callbacks will be called in 
dbus_connection_set_watch_functions. But what about other cases? Should 
I care about add_function and other callback being called again while 
the program is running? Since there is a main loop thread poll for dbus 
fd, if it is blocked, add or remove watcher will not be possible. Will 
other program/daemon try to wake up it if there is pending watcher 
change? And in spite of dbus_connection_set_watch_functions, will other 
function trigger the watcher changes that I need to call during the main 
loop?

Regards,
Xuetian


More information about the dbus mailing list