0

For multi-threading, we can use synchronization primitives like mutexes, semaphore,
condition variables.
How can I synchronize process instances?

For example, if I should not allow more than 1 instance of an application to run, how can I achieve that?

cppcoder
  • 22,227
  • 6
  • 56
  • 81

1 Answers1

0

You can make use of named mutex or system level semaphore to detect if the instance of your application already exists and do not allow the second. additionally you may use single instance project property if you are building a vb.net app. refer to this post for C# implementation with mutex Run single instance of an application using Mutex

Community
  • 1
  • 1
pushpraj
  • 13,458
  • 3
  • 33
  • 50