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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Application Watchdog

Application Watchdog

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 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.
  • Richard Andrew x64R Offline
    Richard Andrew x64R Offline
    Richard Andrew x64
    wrote on last edited by
    #1

    Is there such a thing as a program that watches to make sure another program is running OK, and if it crashes, restarts it? What is the preferred mechanism by which such a thing would be implemented? (Not asking for code, just some ideas)

    The difficult we do right away... ...the impossible takes slightly longer.

    _ A 2 Replies Last reply
    0
    • Richard Andrew x64R Richard Andrew x64

      Is there such a thing as a program that watches to make sure another program is running OK, and if it crashes, restarts it? What is the preferred mechanism by which such a thing would be implemented? (Not asking for code, just some ideas)

      The difficult we do right away... ...the impossible takes slightly longer.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      This is usually done by having a Windows service that watches over your program. There are several such programs available - Search for Application Watchdog[^] Windows from Vista onward also supports Application Recovery and Restart[^] that you can use to have Windows restart your application in case of an unhandled exception.

      «_Superman_»  _I love work. It gives me something to do between weekends.

      _Microsoft MVP (Visual C++)

      Polymorphism in C

      Richard Andrew x64R 1 Reply Last reply
      0
      • _ _Superman_

        This is usually done by having a Windows service that watches over your program. There are several such programs available - Search for Application Watchdog[^] Windows from Vista onward also supports Application Recovery and Restart[^] that you can use to have Windows restart your application in case of an unhandled exception.

        «_Superman_»  _I love work. It gives me something to do between weekends.

        _Microsoft MVP (Visual C++)

        Polymorphism in C

        Richard Andrew x64R Offline
        Richard Andrew x64R Offline
        Richard Andrew x64
        wrote on last edited by
        #3

        Thanks, Superman. :thumbsup:

        The difficult we do right away... ...the impossible takes slightly longer.

        1 Reply Last reply
        0
        • Richard Andrew x64R Richard Andrew x64

          Is there such a thing as a program that watches to make sure another program is running OK, and if it crashes, restarts it? What is the preferred mechanism by which such a thing would be implemented? (Not asking for code, just some ideas)

          The difficult we do right away... ...the impossible takes slightly longer.

          A Offline
          A Offline
          Ashish Tyagi 40
          wrote on last edited by
          #4

          Developing whatch dog on windows is very easy, all you need to create a named mutex from the process (program) needed to moniter, and from your moniter process, wait for that mutex handle to be closed. If it get closed than restart your program. If you are a Linux user than crontab is your friend, use crontab instead of develop new watchdog so that you can spent time to find out why you program is crashing. On windows you can use cronw. Good Luck.

          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