首页> 外文期刊>MSDN Magazine >Concurrent affairs: Implementing the CLR Asynchronous Programming Model
【24h】

Concurrent affairs: Implementing the CLR Asynchronous Programming Model

机译:并发事务:实现CLR异步编程模型

获取原文
获取原文并翻译 | 示例

摘要

Slow and unpredictable are words that typically characterize I/O operations. When an application performs a synchronous I/O operation, the application is basically giving up control to the device that is doing the actual work. For example, if an application calls the StreamRead method to read some bytes from a FileStream or NetworkStream, there is no telling how much time will pass before that method returns. If the file being read is on a local hard drive, then Read may return almost immediately. If the remote server housing the file is offline, then the Read method may wait several minutes before timing out and throwing an exception. During this time, the thread making the synchronous request is tied up. If that thread is the UI thread, the application is frozen and stops responding to user input.
机译:缓慢且不可预测的词通常是I / O操作的特征。当应用程序执行同步I / O操作时,该应用程序基本上是在放弃对实际工作的设备的控制。例如,如果应用程序调用StreamRead方法从FileStream或NetworkStream中读取某些字节,则无法确定该方法返回之前将经过多少时间。如果正在读取的文件在本地硬盘驱动器上,则读取可能会立即返回。如果容纳文件的远程服务器处于脱机状态,则Read方法可能要等待几分钟,然后超时并引发异常。在此期间,发出同步请求的线程被捆绑。如果该线程是UI线程,则应用程序将被冻结并停止响应用户输入。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号