Changing threading semantics from init early to init before second thread

Havoc Pennington hp at redhat.com
Mon Aug 14 08:42:13 PDT 2006


John (J5) Palmieri wrote:
> With Gnome-VFS (and mozilla) being an issue these days in terms of
> making non-threaded apps threaded and killing D-Bus in the process would
> it be possible to fix the internals to be able to init before the second
> thread is started?  In this scenario we keep track of all the
> connections, when dbus_threads_init is called it goes to those
> connections and updates all the dummy mutex's (asserting on mutex's
> that != the dummy mutex || != the new mutex just for sanity checks).
> Since we are still in the main thread there is no race condition at the
> point dbus_threads_init is called.  This would allow Gnome-VFS to init
> threads late in the game without the app having to know.
> 

Do you think it's worth it or will people just fix their apps?

There would be some weirdness still if we did this... for example, if 
you initialized threads while inside a dbus callback, stuff could break 
in all sorts of crazy ways.

Havoc


More information about the dbus mailing list