PATCH: Shortcut activation if exec is already being started
Thu Mar 11 13:44:28 PST 2004
On Thu, 2004-03-11 at 07:49, Mikael Hallendal wrote:
> This is a patch that shortcuts the spawning of another instance of the
> same exec if it's already in the pending queue. This is useful if two
> services are provided by the same binary, if one of the services are
> already pending there is no point in starting another instance of the
> same executable.
I imagine you want to do this by comparing an argv vector:
- if you compare only argv then you can't have something like
"foo --service=bar" and "foo --service=baz"
- if you compare the flattened command line, the optimization will be
defeated if someone changes the whitespace
/* FIXME we need to support a full command line, not just a single
Maybe we should fix that ;-)
A problem with the patch is that the second activation will always time
out if the activated process exits with a failure code, while the first
activation will be canceled immediately. Maybe there's an easy and
uncomplicated way to fix that? It's probably best to just ignore if the
fix makes a mess.
More information about the dbus