DBus Threading in a Late-loading module
nielsen-list at memberwebs.com
Mon Apr 2 08:07:08 PDT 2007
Havoc Pennington wrote:
> Essentially you'd have to require any app using your lib to init dbus
> thread locking. gnome-vfs may already require this though (not sure), so
> the requirement might be fine for gnome-keyring also.
Which is risky, since a PKCS#11 module may be loaded by the OS (eg:
Solaris) or by massive beasts like Mozilla's NSS.
As I look at this further, it seems that I'll have to go cold turkey as
far as libraries. Both DBus and Glib require threading to be explicitly
initialized, and due to late loading of the module, I can't use either.
Looks like get to hand roll my own IPC mechanism. :(
> btw, do be careful with private connections - or at least look at the
> size of the DBusConnection struct in dbus-connection.c first ;-) and
> remember there's an extra file descriptor and so forth as well. It's not
> like it's incredibly expensive, but it should certainly be avoided if at
> all possible for any library that "many" or "most" apps in a typical
> desktop session will be using, since the cost will be multiplied by
> number of apps.
> I assume in this case the communication channel needs to disallow
> eavesdropping from other apps and that's why it's private?
That, and also I was hoping to somehow propose a patch whereby my own
allocator could be passed into libdbus, whereby use of non-swappable
memory could be used. Similar to g_mem_set_vtable (). At least that's no
longer a worry...
More information about the dbus