How to ensure my pb app running only once?

Just starting out? Need help? Post your questions and find answers here.
infratec
Always Here
Always Here
Posts: 6873
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: How to ensure my pb app running only once?

Post by infratec »

You rely on the lock file mechanism of the filesystem.
If your home directory comes over a network connection you'll run into trouble.
And a second user (on a terminal server) can start the program also a second time.
User avatar
skywalk
Addict
Addict
Posts: 3997
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: How to ensure my pb app running only once?

Post by skywalk »

I use the same approach as infratec. Easy to allow option of 1 or multiple instances.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
kpeters58
Enthusiast
Enthusiast
Posts: 341
Joined: Tue Nov 22, 2011 5:11 pm
Location: Kelowna, BC, Canada

Re: How to ensure my pb app running only once?

Post by kpeters58 »

infratec wrote:You rely on the lock file mechanism of the filesystem.
If your home directory comes over a network connection you'll run into trouble.
And a second user (on a terminal server) can start the program also a second time.
While technically true, my apps will never be run under such conditions, as they all are consumer apps - nothing that would ever be run in high/higher end corporate environments.

And to your second point: Just don't use the user's profile directory, but something public - problem solved :)
PB 5.73 on Windows 10 & OS X High Sierra
Post Reply