Using d-bus from multiple threads?

Rémi Denis-Courmont remi at remlab.net
Mon Aug 23 10:38:52 PDT 2010


Le lundi 23 août 2010 20:34:37 Ivan Barr, vous avez écrit :
> Thanks Ville,
> 
> Is this generally received wisdom or from painful personal experience?

There are ample documentation on why this really does not work in the past few 
months on this same mailing list. libdbus was not designed with this in mind.

> Are the d-bus libraries designed to be thread safe or is it that it just
> doesn't work very well?

Yes and no. libdbus only claims to be thread-safe if you call the thread 
initialization function before anything in your process space uses libdbus. 
Thread initialization is not thread-safe (so you can't do it from a library 
that cannot reach main()).

Also libdbus calls a bunch of non-thread-safe functions internally, including 
unsetenv() and Xlib.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis


More information about the dbus mailing list