Closing old connection after fork (Python)

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Aug 22 07:08:31 PDT 2007


On Wed, 22 Aug 2007 at 16:59:37 +0300, Jami Pekkanen wrote:
> > But you'd still have to be very careful not to touch the shared
> > connection from the parent, if any, and disable any main loop setup on
> > the child's copy of the shared connection.
> 
> I tried this also, but the main loop interaction at least in the Python
> API is quite weird and I didn't find a mechanism to explicitly define a
> new loop to use.

At the moment you can't change which main loop is trying to dispatch a
Python bus connection after it's been created. This is something I'll
revisit as part of writing pure-Python (aka "neither GLib nor Qt") main loop
support, when I get time.

libdbus could possibly handle this situation using pthread_atfork(3),
although that might well be considered more trouble than it's worth.

	Simon


More information about the dbus mailing list