Performance of method calls in D-Bus GLib
Abhijeet Kumar Sinha
abhijeet.aks at gmail.com
Thu May 14 10:07:40 PDT 2009
Hello
Earlier I tried using the low level bindings of dbus api to listen for
signals. The dbus signal listener used to miss out some signals. It used the
following snippet
*dbus_connection_read_write(conn,0);
msg = dbus_connection_pop_message(conn);
if ( NULL == msg ){
usleep(1000);
continue;
}*
I re-wrote the code using glib, to use the glib mainloop.I didn't get how to
make the dbus-server listen to signals so I used the
method-call-with-no-reply option. I modified the code present at following
link maemo<http://maemo.org/maemo_training_material/maemo4.x/html/maemo_Platform_Development_Chinook/APPENDIX_D_Source_code_for_the_GLibDBus_synchronous_example.html>.
During the tests I observed that not a single method calls were missed
when the bus was flooded with dbus-send's but when the interval of calling
the message increased like say 60 secs then the server would miss out the
method_call's.
Could anyone explain this. I believed if the message queue is clogged-up
then there are chances of missing out signals/method_call . But here the
case is just the opposite, when flooding happens then every
signal/method_call is received, but if there is no flooding,
signals/method_call's are lost.
I am attaching the code in my-dbus-server.zip .
- value-dbus-interface.xml -- is used to generate the header files using
dbus-binding-tool .
- my-server.c and commons-def.h -- are the part of glib -- c code.
- my-server.conf -- is the configuration file to be placed under
/etc/dbus-1/system.d/ ( I restarted messagebus daemon after this ).
- Makefile -- compiles the code
- random_dbus_signal.sh -- is the client side script which sleeps for
random seconds and then wake up and calls a method of the server -- uses
dbus-send --system --type=method_call
- results -- performance observations.
--
Regards,
Abhijeet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20090514/ea20319f/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: my-dbus-server.zip
Type: application/zip
Size: 4856 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20090514/ea20319f/attachment.zip
More information about the dbus
mailing list