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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:30:51+00:00 2026-05-24T13:30:51+00:00

I’ve read on RegisterWaitForSingleObject in: http://www.albahari.com And I don’t understand when would I prefer

  • 0

I’ve read on RegisterWaitForSingleObject in:
http://www.albahari.com

And I don’t understand when would I prefer to use AutoResetEvent and not RegisterWaitForSingleObject?

It seems that we can always use RegisterWaitForSingleObject, and its better than AutoResetEvent since its not tied to thread.

  • 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-24T13:30:53+00:00Added an answer on May 24, 2026 at 1:30 pm

    You are comparing an apple and an orange. RWFSO needs a wait handle. Like an AutoResetEvent. What RWFSO does is optimize the waiting for the event. Without it, you’ll need to call the event’s WaitXxx() method.

    Caling WaitOne() blocks the thread until the event is Set(). This is something you want to avoid in a threadpool thread because blocked TP threads prevent other scheduled TP threads from executing quickly. The threadpool manager tries the optimize the number of running TP threads so there are no more executing TP threads than cpu cores. A blocking thread kinda screws that up, the manager isn’t otherwise smart enough to know why a thread is blocking. Only when blocking TP threads don’t make progress for half a second does the manager allow another waiting TP thread to execute.

    RWFSO is quite nice but certainly not always appropriate. Programming with it is fairly awkward, especially when you want to handle exceptions. There’s a nasty implicit race if you ever need to cancel it. The TP thread that runs when the event is signaled is subject to the same kind of TP scheduling delays. And there is no RegisterWaitForMultipleObjects(), threading often requires using WaitAny(). Intuitively: on one event that tells the thread something is ready, another event that tells the thread to exit.

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

Sidebar

Related Questions

I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I am trying to understand how to use SyndicationItem to display feed which is
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question

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.