Async DBusMessage reads using the C API

Havoc Pennington hp at redhat.com
Wed Nov 2 09:46:09 PST 2005


On Wed, 2005-11-02 at 09:08 +0000, Matthew Johnson wrote:
> On Tue, 1 Nov 2005, Havoc Pennington wrote:
> 
> > Well, you have to either block on *something* or you have to busy-loop
> > or you have to exit (right? those are the only possible alternatives
> > when you have no immediate processing to do...)
> >
> > I'd take a guess you mean you need to block on something else, so if you
> > block on the dbus socket you'll become unresponsive to the something
> > else. This is the problem a main loop is intended to solve (the main
> > loop just being an abstraction of
> > select()/poll()/WaitForMultipleObjects()) so you can block on multiple
> > things at once.
> 
> Yeah, but a lot of things already have one of these, so don't want to
> retrofit a glib or other mainloop, and just want to throw in a
> non-blocking call. At this level in the API you really need to offer a
> non-blocking as well as a blocking call.
> 

I'm not opposed to the nonblocking call, I was just trying to understand
what you were saying and thus what the use-case is.

So in your program you are blocking on something else, and you won't
"wake up" on dbus activity. I think that can be fine for some apps, but
it isn't the normal case really.

Havoc




More information about the dbus mailing list