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

  • Home
  • SEARCH
  • 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 9088607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:56:26+00:00 2026-06-16T21:56:26+00:00

How can I implement something like pthreads pthread_cond_signal on WinOS. I don’t want to

  • 0

How can I implement something like pthreads pthread_cond_signal on WinOS. I don’t want to use the pthreads Win32 port for this as I also support Win64.

I’m working on a task-based system where a client request spawns n-tasks that spawn n-threads on the server. After the client thread has spawned all the server tasks I want it to enter a sleep state or some other thread state that does not consume any system resources. When all the server tasks have completed I want the client thread to be awoken and return the result(s) to the client application.

Edit:
I’ve thought about waiting for a conditional variable in some shared memory, and check the condvar in a loop, but don’t loops consume resources too? I could add a sleep() inside the loop but then I won’t get the real-time client request & server response – as a task could take 1/1000 of a second (but also multiple seconds).

  • 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-06-16T21:56:27+00:00Added an answer on June 16, 2026 at 9:56 pm

    The Win32 API supports condition variables on Vista and higher. See this MSDN page for the API and this one for example usage.

    WakeConditionVariable() is equivalent to pthread_cond_signal() and WakeAllConditionVariable() is equivalent to pthread_cond_broadcast()

    That said, if you are on VS2012, I’d really recommend that you use the new C++11 threading library. It also has support for condition variables and since running on multiple platforms is important to you, using the standard library could help you eventually merge your codebases.

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

Sidebar

Related Questions

What Swing class can I use to implement something like this? Add To List
can anyone point me in the right direction to implement something like this please:
I want to implement something like ViewPager or ScrollView, but I don't want to
I want to implement something like the Android Calendar week view, where you can
Anybody can provide code snippet how to implement something like SEO Smart Links does
I'm trying to implement something like a photo carousel in jQuery. This carousel could
I want to implement something like voip communication that client doesn't need to install
This is more like a security question. What is best practice to implement something
Say I'd like to implement something like this: def serialize( list: List[_] ) :
Can anybody tell me how can I implement something like the Stack Overflow tags

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.