我在 msdn 上找到了一个异步 ftp 上传示例,它执行以下操作(片段):
// 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();
我在这里不明白的是,如果线程被显式的等待句柄阻塞,异步 IO 会产生什么意义。我一直认为异步 IO 的优点是用户/程序不必等待。