Fwd: Circular calls with DBUS

Havoc Pennington hp at redhat.com
Fri Mar 23 05:56:25 PDT 2007


Jacques Guillou wrote:
> Is there a way to configure the GLib binding in such a way that an 
> incoming message can be preocessed even if the main loop execution is 
> stopped into a synchronous call (waiting for its answer) ?
> Would that be safe ?
> 
> I really think using asynchronous calls only would make a system much 
> more complex than it would be if synchronous calls were allowed.
> 

Despite decades of programmers looking for one, there's no magic 
solution to this sort of issue ;-) To allow async calls like that you'd 
need to have the incoming call be processed in its own thread, which 
would be a whole other set of complexity (maybe overall better, maybe 
overall worse, depends on the app). Anyway, afaik the glib bindings 
don't have a way to say "put this object in its own thread" right now.

Often a big simplification you can make is to make one process clearly 
client and one clearly server and don't have the server make method 
calls on the client. Signals can be emitted in either direction.

Havoc


More information about the dbus mailing list