I understand how to force a single instance of an application using a mutex and this is what I use.
Several of my users have asked me to allow multiple instances to run. I don’t want to remove the control code as I can see it as a recipe for disaster since multiple instances could be writing to the same files, log and so on.
I perhaps could handle things if the number of instances is limited to two. My current idea is to allow the first one to run as the active one and a second in some form of read-only mode.
So how would I control the number of instances to no more than two?
Thanks
1 Answer