[Interest] Detecting if the application is already running from another user account

Thiago Macieira thiago.macieira at intel.com
Sat Jun 4 00:06:15 CEST 2016


On sexta-feira, 3 de junho de 2016 15:49:29 BRT Etienne Sandré-Chardonnal 
wrote:
> The issue with file locking, is every OS does not have a system-wide
> user-writable standard folder. There is /tmp on linux/unix which is
> standard, but AFAIK windows only has per-user temporary file, and system
> temp which is not user writable.

I personally think that you should re-evaluate why you even want this in the 
first place. This is incredibly bad UX.

Why is it bad that one user launch the application while another is using it? 
Isn't this a vector for denial? One user could leave the application running, 
log out and go away for a month-long vacation, which means no one can use it 
for 30 days unless an admin gets involved, killing the application (and 
possibly costing that user some unsaved work).

Is this about a shared resource that only one user can access at a time? If it 
is in a network segment, then you need to deal with multiple machines running 
at the same time, which means no local solution will work. Additionally, it 
usually means the users have read-write access to that resource, so that's 
where the locking should happen.

If it's about hardware, check if your OS doesn't provide you with locking 
already. You probably need that in case someone is running another 
application, not yours, that may access that hardware.

> Thiago : some times ago, you wrote about an extension of the QSharedMemory
> API for having opt-in system wide shared memory in a future Qt release. Was
> this abandonned?

I have no clue what you're talking about.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list