Multiple Instances of sweeper and autopatcher = crash
Posted: Sat Jul 26, 2014 7:17 pm
Just an FYI
I accidentally started autopatcher while an instance was running. It crashed.
I accidentally started "sweeper /verbose " while an instance was already running. it looks like it crashes due to not being able to access the log file (this would make sense).
If I'm developing an app where only 1 instance should be allowed, the technique that I usually use is to acquire a known, unique global semaphore at program initialization. If the semaphore doesn't exist, the app creates it and gets it. if it does exist, it means an instance of the app is already running and either exit or push/switch to the already running process, if this behaviour is desired. Just don't forget to remove/release the semaphore when exiting.
I accidentally started autopatcher while an instance was running. It crashed.
I accidentally started "sweeper /verbose " while an instance was already running. it looks like it crashes due to not being able to access the log file (this would make sense).
If I'm developing an app where only 1 instance should be allowed, the technique that I usually use is to acquire a known, unique global semaphore at program initialization. If the semaphore doesn't exist, the app creates it and gets it. if it does exist, it means an instance of the app is already running and either exit or push/switch to the already running process, if this behaviour is desired. Just don't forget to remove/release the semaphore when exiting.