Please help with signals, some seem to get lost

Erik Slagter erik at slagter.name
Mon Jan 13 13:14:40 UTC 2025


Hi there,

I'll start with a terse description of what I am facing, maybe that is 
enough for you guys to point me in the right direction. If not, I'll 
elaborate.

For my application I need to send signals to several listeners on the 
system bus. The signals are composed of a string of about 300 bytes. 
Sometimes some signals are sent in quick succession and that's where it 
goes wrong.

I use this code (I'd like to keep things very simple, no main loops etc, 
the handler runs in it's own thread anyway):

dbus_connection_read_write_dispatch(connection, -1) // blocks until a 
message is received, quit if negative result
message = dbus_connection_pop_message(connection)

Now every now and then dbus_connection_read_write_dispatch returns from 
blocking but dbus_connection_pop_messages returns NULL.

Two interesting observations here:
- other processes that are listening to the same signal do get the 
message indeed, it's just one (random) of them that gets the NULL message
- if I apply rate limiting, the problem decreases and at a rate of 2 
signals per second it's gone.

So it looks like I am hitting a rate limiter somewhere. I really want to 
go full throttle here, is there a way to change this parameter? Is there 
another workaround for this?

Thanks in advance!


More information about the dbus mailing list