Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 833051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:27:27+00:00 2026-05-15T04:27:27+00:00

I have two Windows services, we’ll call X and Y. X handles the general

  • 0

I have two Windows services, we’ll call X and Y. X handles the general functionality for my application, and Y exists to keep X up to date. It does this by checking for updates to X. If they exist, it downloads them, shuts down X, copies in the new files, and restart X.

However, I’d like Y to do the same thing for X. My concern, though, is that it’s possible for each service to shut each other down, meaning they never get restarted.

I can think of three solutions:

  1. Maintain a third service, Z, which
    is never updated, that only checks
    if each service has been shut down
    for more than a minute, and if so,
    restarts them. This wouldn’t be a
    bad thing to have, anyway, but it
    seems like something that I’d like
    to be able to update, which
    introduces the original problem,
    again.
  2. Maintaining a lock in the registry,
    such that X checks if Y is updated
    before doing an update itself, and
    vice versa.
  3. Having each service start the other services in its OnStop method. This seems a bit hackish, though.

What is the proper solution to this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:27:28+00:00Added an answer on May 15, 2026 at 4:27 am

    I ended up using System.Threading.Mutex. Both services will always run on the same machine, so it’s a super easy solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written two different applications running as windows services. Each application represents one
In my application I have one windows form application and two windows services. Currently
Let's say I have two windows services running. One service is 'Polling' - it
I have a Windows Azure site which is deployed to two separate hosted services.
I have two windows application, one is a windows service which create EventWaitHandle and
I have two versions of a Windows Forms Application and can't figure for the
I have two Windows services written in C# following the same patterns and methodology.
I have two Windows services, the first one written in C# and the second
I have two windows application. eg ., FormA and FormB The app.config of FormA
i have two questions: can windows services register to receive SENS network events because

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.