I use Semaphore to limit the number of simultaneous instances that my application can run.
There are many ways to stop the process. Is it possible to create Semaphoreso that it automatically frees up when the process ends?
EDIT:
I would like some kind of magic to automatically clear the state with a raised semaphore for the process that it owned when it exited or failed. Just to be sure that it is cleansed no matter what.
MORE:
I am looking for a viable option for you, given:
- It would be great that no external application is required for external access to any instance of a secure application.
- it should not be a semaphore - any synchronization object that has a COUNTER and is AUTOMATICALLY released after the death of the process owner will be fine, even if it cheats
- I am using .NET 2.0, I can’t switch to a newer version of this project, but I can use c / C ++ and inter-op to use something if there is something
source
share