C convenience lib (was Re: Is dbus_pending_call_set_notify() thread safe?)

Havoc Pennington hp at redhat.com
Fri Aug 3 08:44:10 PDT 2007


Hi,

Thiago Macieira wrote:
> Havoc Pennington wrote:
>> 3)
>>
>> The shared connections are intended to be "claimed" by some dispatcher.
> 
> That doesn't answer the question of what happens if they aren't claimed by 
> anyone.

I guess I consider this a "don't do that then" - we should just arrange 
the "platform stacks" (GNOME/KDE) to avoid this case.

We could solve it in theory like threads_init so a plugin or lib could 
dispatcher_init on a "just in case" basis, but I think it's almost as 
good if it's just expected that an app has connected to dbus, in the 
same way it's expected that it's connected to the X server.

The key point is, I'm not expecting libs and plugins to work no matter 
what arbitrary bundle of stuff someone is tossing together in their 
application ;-) - ultimately the app has to make sense and be coherent, 
  and the platform has to be somewhat defined.

>> which would allow object system mappings to do an
>> assert(I have the right dispatcher)
> 
> What if it doesn't have the right dispatcher? Should it abort the 
> application?

Yes, most likely, though I can imagine in a plugin a thing like:

  if (!my_object_mapping_init()) {
     fprintf(stderr, "MyPlugin can't load because it requires QtDBus 
which conflicts with %s\n", dbus_get_dispatcher_name());
     return DO_NOT_LOAD_ME;
  }

But in application code if you have the wrong dispatcher something is 
probably just messed up in an unrecoverable-at-runtime way.

Havoc


More information about the dbus mailing list