[Qt-interest] A couple of Issues in Qt Application

Raja Rokkam rokkamraja at gmail.com
Fri Oct 30 03:18:04 CET 2009


Hi Dan,

    Thanks for the solution and yeah, your points are worth thinking given
the long term features and upgrades to this application.

-Raja.

On Fri, Oct 30, 2009 at 7:37 AM, Dan Mills <dmills at exponent.myzen.co.uk>wrote:

> The Unix way of doing this is to create a 'lock' file containing the PID
> of the process, then on startup, check if the lockfile exists, if it
> does, check to see if the PID refers to a copy of your program.
>
> The second check ensures that a crash will not prevent a new copy
> starting.
>
> I would note that you want to think carefully about single instance
> programs that are not daemons given that unix is by design multi user,
> for true 'one running instance per system' (which usually means a system
> daemon or similar), the lock files typically end up in /var/run/, for
> things that should be one instance per user, ~/.appname.lock is fairly
> conventional, but think long and hard about why you want single instance
> here, it tends to cause cursing sooner or later.
>
> HTH.
>
> Regards, Dan.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091030/1de519d6/attachment.html 


More information about the Qt-interest-old mailing list