Tracking DBusWatches

tsuraan tsuraan at gmail.com
Fri Feb 9 11:53:03 PST 2007


> It would be an ugly work around for a bug in your app at the expense of
> increased CPU usage (and diminished battery life in laptops).


So the "correct" solution is to basically ignore read_write_dispatch and
implement the exact same thing, but with an additional socket that's used
just to wake up the thread that's waiting for file descriptor activity?
This additional socket would just have a byte of arbitrary data shoved into
it whenever the dbus message queue has something added to it, so that the
waiting thread polls the queue, right?  That seems terribly hackish to me.
Is calling poll ten times a second really that expensive?  It seems like you
have a handful of instructions to check the message queue's state, and then
you go back to polling for another hundred ms.  Would it even be possible to
detect that amount of CPU activity?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20070209/44b14835/attachment.htm


More information about the dbus mailing list