Replacing evil looping code

Alexander Larsson alexl at redhat.com
Tue Nov 7 01:56:33 PST 2006


On Mon, 2006-11-06 at 11:03 -0500, Havoc Pennington wrote:
> Bastien Nocera wrote:
> > To be fair, we don't really need that "PID" bit, but we'd need one
> > instance of the service per instance of our plugin in Mozilla (well,
> > pretty much).
> > 
> > If we can that one-to-one relationship without using a dynamic service
> > name, it wouldn't bother me one bit to use it. I didn't see any ways to
> > have that using the service route.
> 
> Well, each connection does have a unique bus name generated by the bus 
> that you can refer to it by. You could easily skip making up your own 
> bus name - instead of generating the name with the pid and then 
> requesting that name and listening for NameOwnerChanged, just have the 
> new process emit a signal like TotemPluginStartedUp, maybe with the PID 
> as an argument to the signal, and then from that point forward use the 
> unique bus name of the signal emitter.

Why not just pass the unique bus name of the parent to the spawned child
and have the child send a "i'm ready" message to the passed name.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's a time-tossed playboy sorceror with acid for blood. She's a radical 
tempestuous angel from a secret island of warrior women. They fight crime! 



More information about the dbus mailing list