this MSDN sampleを理解しようとしているが、私はこれらの行について困惑している:あなただけのタスクがとにかく完了するまでスレッドをブロックしようとしている場合たとえばちょうどEndを呼び出しているのなら、WaitOneを呼び出すのはなぜですか?ブロックしませんか?
IAsyncResult result = Dns.BeginGetHostEntry(args[0], null, null);
Console.WriteLine("Processing request for information...");
// Wait until the operation completes.
result.AsyncWaitHandle.WaitOne();
// The operation completed. Process the results.
try
{
// Get the results.
IPHostEntry host = Dns.EndGetHostEntry(result);
、なぜも、非同期プログラミングを使うのか?また、WaitOne
と呼ぶのは何ですか?操作が完了するまでEnd機能は自動的にブロックされませんか?
こっちにかなり混乱し...
これはそうではありません。http://msdn.microsoft.com/en-us/library/ms143989%28v=VS.100%29.aspx –
Hans:どういう意味ですか? –