using the wakeup_main_function together with dispatch_status_function

jim harvey jimharvy at gmail.com
Wed Sep 24 01:51:35 PDT 2008


Hi,

i'm writing a simple dbus mainloop in C for a service exposing methods via
dbus.
my implementation is using DBusWatch-es and is very similar to
http://lists.freedesktop.org/archives/dbus/2007-October/008859.html

i've set both a wakeup_main_function and a dispatch_status_function to be
notified when i need to dispatch (its a multithreaded application).
what i do in the dispatch_status function is essentially:

if (dispatch_status == DATA_REMAINS)
   wakeup_main_function();


it seems to me that both of these functions are called when there is a new
message in the incoming/outgoing queue.
is one preferable to the other? or should i leave both?


also an aside question: i've implemented the mainloop without timeouts (i
have stubs with debug_prints for the add_timeout/remove_timeout functions).
using the debug prints, i dont see these functions called during the
operation of the service. is imeplementing timeouts mandatory?

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20080924/e460945a/attachment.htm 


More information about the dbus mailing list