From kde-core-devel Sun Mar 23 18:18:50 2008 From: Robert Knight Date: Sun, 23 Mar 2008 18:18:50 +0000 To: kde-core-devel Subject: Re: [PATCH] Allow forced new processes for KUniqueApplication Message-Id: <1206296330.30008.19.camel () robert-laptop> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=120629638426593 Hi, > The two together seem... odd. How can you not fork and yet force a new > process? :-) I think the name ForceNewProcess is misleading. What I really mean is "don't re-use an existing instance of this application" which is done by using a process-specific name when registering with the DBus server. The sequence of events when starting two instances with just ForceNewProcess would be: (Process 0) KUniqueApplication::start() (forks => Process 1) (Process 1) KUniqueApplication::newInstance() (Process 0 Exits) (Process 2) KUniqueApplication::start() (forks => Process 3) (Process 2 Exits) (Process 3) KUniqueApplication::newInstance() With ForceNewProcess | DoNotFork: (Process 0) KUniqueApplication::start() (Process 0) KUniqueApplication::newInstance() (Process 1) KUniqueApplication::start() (Process 1) KUniqueApplication::newInstance() With no flags: (Process 0) KUniqueApplication::start() (Process 0) KUniqueApplication::newInstance() (Process 1) KUniqueApplication::start() (Process 0) KUniqueApplication::newInstance() Regards, Robert. On Sun, 2008-03-23 at 18:56 +0100, Thiago Macieira wrote: > Robert Knight wrote: > >StartFlags { > > ForceNewProcess = 0x1 , > > DoNotFork = 0x2 > >} > > The two together seem... odd. How can you not fork and yet force a new > process? :-) > > Anyways, I'd suggest the multiple instances approach. How about > AllowMultipleInstances, thus matching the config? >