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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:11:00+00:00 2026-06-11T06:11:00+00:00

In this article , section ‘More Waiting…’, when author talked about synchronize i/o with

  • 0

In this article, section ‘More Waiting…’, when author talked about synchronize i/o with thread, the 1st example he gives is:

hFile = CreateFile(....,FILE_IO_OVERLAPPED,...);
ReadFile(hFile,...)
< Do some computation.>
WaitForSingleObject(hFile,INFINITE);

I had the impression that both ‘CreateFile’ and ‘ReadFile’ are synchronous APIs, no? Why would a ‘WaitForSingleObject’ needed here? Wouldn’t ‘CreateFile’ and ‘ReadFile’ block until the operation is over and then return?

Then some more confusion coming when author talks about ‘alertable waiting’. What is it, a thread state after WaitForSingleObjectEx()? then why author give:

while (WaitForSingleObject(hObject,TRUE)==WAIT_IO_COMPLETION);

as example instead of

while (WaitForSingleObjectEx(hObject,TRUE)==WAIT_IO_COMPLETION);

?

and should ‘ex’ functions be together like:

hFile = CreateFile(....,FILE_IO_OVERLAPPED,...);
ReadFileEx(hFile,...)
< Do some computation.>
while (WaitForSingleObjectEx(hObject,TRUE)==WAIT_IO_COMPLETION);

Any one can explain a little more?

Thanks,

  • 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-11T06:11:01+00:00Added an answer on June 11, 2026 at 6:11 am

    The document also states following:

    Asynchronous I/O is a way the operating system provides for letting
    I/O instructions execute in the background, the idea being roughly
    that a call to ReadFile or WriteFile will return immediately to the
    caller and overlap the I/O operation itself with the computation of
    the thread that called it in the first place. This technique only
    works for I/O devices whose drivers support asynchronous I/O and
    manifests itself to the programmer through the flag FILE_IO_OVERLAPPED (*)
    that can be passed to the CreateFile call. I/O performed on such a
    file object will behave quite differently from synchronous I/O.

    The methods are synchronous/asynchronous depending on parameters passed to CreateFile

    * should read FILE_FLAG_OVERLAPPED

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

Sidebar

Related Questions

Looking at this article from MS, I have a question about the SolutionToBuild section.
I just read this article: The Truth About Garbage Collection In section A.3.3 Invisible
In this article, (toward the end in the 'Windows Communication Foundation' section) the author
At the end of this wikipedia article, in a section A simple example in
I was reading this article by Brian Goetz. Under the section Don't start threads
I have a div like this <section class=item_container> <article class=item> <h2>Page Title</h2> <p><a class=delete_page
Near the bottom of this article ( MSDN ) in a section entitled The
I'm trying to use this article to learn about custom roleproviders, but I'm getting
I read up on this article about Perlin Noise and have a few questions
As stated in the first section of this article (.chm file - see note

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.