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. To Service or not to Service

To Service or not to Service

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionsysadminhardwareperformance
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.
  • D Offline
    D Offline
    Dustin Henry
    wrote on last edited by
    #1

    Hi all, I am currently writing a program that will be running on an XP-embedded machine that will act as a watchdog and launcher of another application. Naturally, since this needs to be persistent on the machine, it makes since to write it as a windows service. However, I'm not sure what benefits this will have over a standard application because I have not had a great deal of experience writing services. For one, these machines will never be touched by end-users so an application running in the taskbar would not have the problem of an accidental closure or user error. Two, this program may require relatively constant communication with the application it opens and know if it dies so it can report back to a central server, as well as status update to said server. So I guess my overall question is are there any caveats to writing this as a windows service? Is there any performance gain or loss when it comes to messaging between the applications? Any opinions and thought are greatly appreciated. Thanks, Dustin

    J 1 Reply Last reply
    0
    • D Dustin Henry

      Hi all, I am currently writing a program that will be running on an XP-embedded machine that will act as a watchdog and launcher of another application. Naturally, since this needs to be persistent on the machine, it makes since to write it as a windows service. However, I'm not sure what benefits this will have over a standard application because I have not had a great deal of experience writing services. For one, these machines will never be touched by end-users so an application running in the taskbar would not have the problem of an accidental closure or user error. Two, this program may require relatively constant communication with the application it opens and know if it dies so it can report back to a central server, as well as status update to said server. So I guess my overall question is are there any caveats to writing this as a windows service? Is there any performance gain or loss when it comes to messaging between the applications? Any opinions and thought are greatly appreciated. Thanks, Dustin

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      I work on XPe and we do everything quite deliberately as applications, not services. The only real benefit a service has is the built in ability to be restarted by the service manager. Our solution is make sure our "services" don't crash. (Some of our services can't really be restarted anyway On the negative side, services are annoying to debug (when problems happen when in service mode) and maintain in an XPe environment. In our case, we push down updates, the machine reboots and the updates are xcopy installed. Can't do this with services.

      Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

      D 1 Reply Last reply
      0
      • J Joe Woodbury

        I work on XPe and we do everything quite deliberately as applications, not services. The only real benefit a service has is the built in ability to be restarted by the service manager. Our solution is make sure our "services" don't crash. (Some of our services can't really be restarted anyway On the negative side, services are annoying to debug (when problems happen when in service mode) and maintain in an XPe environment. In our case, we push down updates, the machine reboots and the updates are xcopy installed. Can't do this with services.

        Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

        D Offline
        D Offline
        Dustin Henry
        wrote on last edited by
        #3

        Thanks Joe, that is very informative and helpful. We actually just had another meeting about it and I believe we are turning away from the service idea. Thanks, Dustin

        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