0

I have a Console app on C# that is going to be deployed 4 times, with different configuration files, each instance will be fire off using a Windows Task scheduler, each will be running process and sometimes will be a long running process. Each task is configured to run every hour. How to avoid that scheduler create a new instance of the app that stills running so it wont run again the process that still pending but maybe is being process by the previous instance that is running.

Edit

It is going to be deployed once with 4 different configuration files, that will run independently using different DBs, so it will be some times long process. So I don't know how to identify each instance, so in the case that my instance 1 is running and the task scheduler for that specific configuration don't run again, so it will skip this run

Thanks

  • So you want up to 4 different instances running t once (`deployed 4 times`)? – mjwills Apr 05 '18 at 21:34
  • > I have a Console app on C# that is going to be deployed 4 times, If this is 4 instances on the same machine, you can use System.Threading.Mutex() and have each instance make sure it's not running before starting another one. More info here: https://stackoverflow.com/questions/4722198/checking-if-my-windows-application-is-running – Terry Carmen Apr 05 '18 at 21:42
  • Your edit is a completely different unrelated question that in no way doesn't make this question a duplicate of the others. Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [the perfect question](http://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/), then click the "Ask Question" button and add your second question with enough detail so it can actually be answered. – NightOwl888 Apr 06 '18 at 05:46

0 Answers0