Changing threading semantics from init early to init before second thread

Alexander Larsson alexl at redhat.com
Mon Aug 21 01:38:03 PDT 2006


On Mon, 2006-08-14 at 17:19 -0400, Havoc Pennington wrote:

> There's no real problem with that (it's detectable but not significant 
> in the profile). The reason dbus_init_threads() exists is to avoid 
> maintaining a Windows/UNIX thread abstraction in dbus itself, and just 
> use the ones in GLib, Qt, etc. Secondarily, to let people install 
> special thread implementations for debugging purposes or whatever.
> But mostly to avoid having a thread abstraction in dbus itself.
> 
> It may well be kind of pointless, as the simple operations dbus needs do 
> not necessarily take a lot of abstraction; dbus does not need to create 
> threads for example.

Yeah, it strikes me as possibly a better idea to just add some simple
internal mutex and condvar wrappers in dbus (with pthreads and win32
implementations). As things are now you get into all sorts of
complications if you're mixing things with their own threading
abstractions (say Qt and glib) in a process that share a dbus
connection.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's a gun-slinging arachnophobic grifter who knows the secret of the alien 
invasion. She's a time-travelling thirtysomething detective with the soul of a 
mighty warrior. They fight crime! 



More information about the dbus mailing list