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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:42:58+00:00 2026-05-26T07:42:58+00:00

How can I send an event to several running threads of my application? For

  • 0

How can I send an event to several running threads of my application?

For example: My main thread wants to signal all running threads that the application will exit.

I’m a little confused which of those possibilities leads to an easy and reliable solution:

  • condition_variable with notify_all from boost
  • CONDITION_VARIABLE with WakeAllConditionsVariable from WinApi
  • CEvent from WinApi
  • using a mutex and try_lock on the threads
  • signal and slots from boost
  • or even a global variable with a CriticalSection for protection of getter/setters
  • insert your solution here…

Could you point a beginner into the right direction and perhaps loose some words about the possiblities above I provided.

Added: – OS is Windows XP

  • 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-26T07:42:58+00:00Added an answer on May 26, 2026 at 7:42 am

    Given you want to “signal all running threads that the application will exit” a manual reset even would do the trick.

    You need to have each thread check the event occasionally and exit if the event has been signalled.

    You then simply signal the event and wait for the threads to complete if you need to.

    It’s more complex if you need to do this more than once as a manual reset event must be reset manually and you’d need more code to make sure that every thread has received the notification before you reset the event for use in subsequent notifications, but given your question, this will work just fine.

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

Sidebar

Related Questions

Is there a way to have a custom control send events that can be
I know that soap can send XML over http, is there any way to
Using cURL I can send a GET request with a body. Example: curl -i
I have several sites where users can send me email through an html form
My application communicates with several GSM electric controllers, that means that I have to
I can't send email to my app users, even though I have the permissions.
I can send requests to friends using Multi Friend Request Selector inside my Page
How this UIButton rewind can send notification to UIButton play to perform playpauseaction method
In Javascript I can send XML string to JSP server (XmlAction.jsp): Javascript Code: var
how i can send key from my C# program to external program ? ex:

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.