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 917369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:12:04+00:00 2026-05-15T18:12:04+00:00

Is there a Windows (or .NET) synchronization primitive that: can be shared across multiple

  • 0

Is there a Windows (or .NET) synchronization primitive that:

  • can be shared across multiple processes on the same PC;
  • represents a counter of how many threads are currently depending on a shared resource;
  • is automatically decremented by the OS when a process abnormally terminates; and
  • can be waited on by another process (and signaled when the count drops to zero)?

I want to share a resource across multiple processes, and then close the resource when the last process exits (whether normally or abnormally) or declares that it’s done with the resource. There would have to be some handshaking on startup, but that’s doable; the interesting part is waiting for the processes to exit.

As far as I can tell, a named semaphore (with a high initial count) could satisfy all but the last requirement. But semaphores count down instead of up, and I don’t see a way to wait for one to reach its maximum count.

If no primitive exists for this, is there a .NET library that creates something like it, or information on how to build one?

(This is for a possible implementation for How can I wait until a Windows process, and its subprocesses, have all exited?. But whereas that question has many possible approaches, here I specifically want to explore whether synchronization objects are up to the task. They’re the first approach that occurred to me, but I’m hoping to learn something here about whether they really would work for this.)

  • 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-15T18:12:04+00:00Added an answer on May 15, 2026 at 6:12 pm

    There are no primitives that satisfy all these conditions. You’d have to build your own cross-process equivalent of CountdownEvent.

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

Sidebar

Related Questions

There are now so many ways to write windows apps, win32, MFC, ATL, .NET,
Is there a windows (win32, .net) debugger which can do something like gdb checkpoint?
Is there any way a .NET windows app can be deployed on cloud? what
Is there something like shared storage in .net windows forms applications, What I want
is there any windows api that can send mail using smtp along with attachment
In C#/.NET (on Windows) is there a way to read a growing file using
Are there any known issues with ASP.Net Ajax and IE6 in Windows 2000 machines
I have a windows forms application in .NET 3.5. There's one form with 20
Is there a Windows API call or Delphi call that will tell me what
I want to migrate my existing desktop Windows .NET 3.5 app. that uses MySQL

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.