When is dbus_threads_init_default needed?

John (J5) Palmieri johnp at redhat.com
Wed Apr 2 14:55:39 PDT 2008


On Wed, 2008-04-02 at 13:11 -0400, David Belser wrote:
> I have a multi-threaded application where I am using private
> connections in a few threads - do I need to call
> dbus_threads_init_default or is the fact that I'm using private
> connections enough? In other words, are there global data structures
> in the dbus lib that are shared even if the connections are private?
> 

There is little reason not to call it but yes I believe private
connections do modify a table when created.  I can't quite remember
without diving into the code but the chances that there is no
interaction vs. the chances that you just haven't hit a race condition
are tilted towards the latter.  The performance hit when turning on
threading should be negligible.

-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list