Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to delay to open second instance of application

How to delay to open second instance of application

Scheduled Pinned Locked Moved C#
csharptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    himuskanhere
    wrote on last edited by
    #1

    hi everybody. I have an C# desktop application, it support multiple instances. but in my case, my application get 10-15 sec to load and if in between second instance get started, it will crash. So i wish multiple instance application but even if there will be successive two double click to start application, second ,third instance should wait a while.. I have tried mutex but i have no detail idea of mutex. Pls give me a way to do it Thanks in advance.:thumbsup:

    R 1 Reply Last reply
    0
    • H himuskanhere

      hi everybody. I have an C# desktop application, it support multiple instances. but in my case, my application get 10-15 sec to load and if in between second instance get started, it will crash. So i wish multiple instance application but even if there will be successive two double click to start application, second ,third instance should wait a while.. I have tried mutex but i have no detail idea of mutex. Pls give me a way to do it Thanks in advance.:thumbsup:

      R Offline
      R Offline
      Rob Philpott
      wrote on last edited by
      #2

      Just a quick point - it'd be better to avoid crashes when multiple instances start by addressing that rather than delaying start up. Why does it crash? You may be able to get a more granular critical section that way. Failing that then a Mutex probably is the way to go.

      Regards, Rob Philpott.

      H 1 Reply Last reply
      0
      • R Rob Philpott

        Just a quick point - it'd be better to avoid crashes when multiple instances start by addressing that rather than delaying start up. Why does it crash? You may be able to get a more granular critical section that way. Failing that then a Mutex probably is the way to go.

        Regards, Rob Philpott.

        H Offline
        H Offline
        himuskanhere
        wrote on last edited by
        #3

        Hi Rob , Thanks for reply/ I am not able to find a reason for crash but it may be reading/writing file at a same time. Any idea about mutex.WaitOne(...) Thanks

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups