What sense does asynchronous IO make if the thread is blocked anyway (see example)

Posted by codymanix on Stack Overflow See other posts from Stack Overflow or by codymanix
Published on 2010-03-31T08:38:01Z Indexed on 2010/03/31 8:43 UTC
Read the original article Hit count: 487

Filed under:
|
|
|
|

Hello, I found an example for async ftp upload on msdn which does the following (snippet):

        // Asynchronously get the stream for the file contents.
        request.BeginGetRequestStream(
            new AsyncCallback (EndGetStreamCallback), 
            state
        );

        // Block the current thread until all operations are complete.
        waitObject.WaitOne();

The thing what I do not understand here is, which sense does asynchronous IO make if the thread is blocked anyway with an explicit waithandle. I always thought the advantage of asynchronous IO was that the user/programm does not have to wait.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET