none
异步多线程下await streamRead.ReadToEndAsync()进程会死锁如何解决? RRS feed

  • 问题

  • 异步多线程下await streamRead.ReadToEndAsync()进程会死锁,这是怎么回事?对于同时开启多个线程怎么办呢?

    	HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(booklink);
            myHttpWebRequest.Method = "POST";
            HttpWebResponse myHttpWebResponse = (HttpWebResponse)await myHttpWebRequest.GetResponseAsync();
            Stream streamResponse = myHttpWebResponse.GetResponseStream();
            StreamReader streamRead = new StreamReader(streamResponse);
            string htmltext = await streamRead.ReadToEndAsync();

    2012年8月13日 14:46

全部回复