Event-based Asynchronous Pattern Overview基于事件的异步模式概览_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > Event-based Asynchronous Pattern Overview基于事件的异步模式概览

Event-based Asynchronous Pattern Overview基于事件的异步模式概览

 2015/5/4 22:47:28  ChuckLu  程序员俱乐部  我要评论(0)
  • 摘要:https://msdn.microsoft.com/zh-cn/library/wewwczdw(v=vs.110).aspxApplicationsthatperformmanytaskssimultaneously,yetremainresponsivetouserinteraction,oftenrequireadesignthatusesmultiplethreads.同时执行多项任务,并且仍要相应用户交互的应用,通常需要一个使用多线程的设计。TheSystem
  • 标签:事件 view Ron 模式 ASE 异步

https://msdn.microsoft.com/zh-cn/library/wewwczdw(v=vs.110).aspx

Applications that perform many tasks simultaneously, yet remain responsive to user interaction, often require a design that uses multiple threads.
同时执行多项任务,并且仍要相应用户交互的应用,通常需要一个使用多线程的设计。
The System.Threading namespace provides all the tools necessary to create high-performance multithreaded applications,
System.Threading命名空间提供了所有必要的工具来创建高效的多线程应用
but using these tools effectively requires significant experience with multithreaded software engineering.
但是有效的使用这些工具需要有丰富的使用多线程软件工程的经验
For relatively simple multithreaded applications, the BackgroundWorker component provides a straightforward solution.
相较而言,简单的多线程应用,BackgroundWorker组件提供一个简单的解决方案
For more sophisticated asynchronous applications, consider implementing a class that adheres to the Event-based Asynchronous Pattern.
对于更复杂的亦不应用,可以考虑实现一个支持基于事件的异步模式的类

The Event-based Asynchronous Pattern makes available the advantages of multithreaded applications while hiding many of the complex issues inherent in multithreaded design. Using a class that supports this pattern can allow you to:
基于事件的一步模式,利用了多线程应用的优点,同时隐藏了多线程设计中固有的复杂问题,使用支持此模式的类,可以确保你:
1.Perform time-consuming tasks, such as downloads and database operations, "in the background," without interrupting your application.
在后台执行耗时的任务,比如下载或者数据库操作,但是不会中断你的应用
2.Execute multiple operations simultaneously, receiving notifications when each completes.
同时执行多个操作,当每一个操作都完成的时候,接收通知
3.Wait for resources to become available without stopping ("hanging") your application.
等待资源可用,而且不会停止你的应用
4.Communicate with pending asynchronous operations using the familiar events-and-delegates model.
使用熟悉的事件委托模式,来和挂起的异步操作通讯

发表评论
用户名: 匿名