What is the point of making asynchronous IO if the thread is blocked anyway (see Example)

I found an example for loading async ftp on msdn that 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();

What I don't understand here is what IO asynchronous input does if the thread is blocked anyway with an explicit waithandle. I have always believed that the advantage of asynchronous I / O is that the user / program does not need to wait.

+3
source share
3 answers

This is just an example.

Real World (TM) . , GUI , .

async , GUI - , .

+4

- , , .

, , - - , .

+1

, . , , , , , .

+1
source

Source: https://habr.com/ru/post/1739274/


All Articles