Easier programming asynchronous calls
来源:互联网 发布:淘宝配送地址怎么设置 编辑:程序博客网 时间:2024/05/21 06:32
Asynchronous calls can improve scalability, however, it's always more difficult for us to do programming jobs under an asynchronous calling manner. The main reason is, asynchronous calls need callbacks everywhere, thus local variables and parameters in the current scope can not be easily passed through (ofcause you can use lambdas and anonymous methods, but they can't solve all the problems either). Moreover, when you need to perform many tasks which should be completed in an sequential order, for example, the latter asynchronous call may need to use the result of a previous one, it'll be even harder to implement, and if you've done it, the code may look terribly wired and not intuitive enough for understanding and maintaining.
For these reasons, programming asynchronous calls in synchronous manner is needed. I've looked through some articles on the internet and I think some resources listed here may worth you to have a look at:
1. Jeffrey Richter's Power Threading library.
http://www.wintellect.com/CS/blogs/jeffreyr/archive/2008/12/04/7380.aspx#7383
In the implementation for this library Jeff has used the C# 2.0 language's great 'iterator' feature (yield return) to achieve it. By following his examples you can easily program asynchronous calls in an synchronous manner and at the same time, you can still take the advantage of various C# features like foreach/lock/try..catch, and so on. Also, this awesome library has an version for Silverlight.
2. Synchronous Web Service Calls with Silverlight 2: Dispelling the async-only myth
http://www.codeproject.com/KB/silverlight/SynchronousSilverlight.aspx
This great article by Daniel Vaughan is for calling WCF Services in Silverlight, in an synchronous programming style, it's also easy to understand and the idea is explained in detail.
For these reasons, programming asynchronous calls in synchronous manner is needed. I've looked through some articles on the internet and I think some resources listed here may worth you to have a look at:
1. Jeffrey Richter's Power Threading library.
http://www.wintellect.com/CS/blogs/jeffreyr/archive/2008/12/04/7380.aspx#7383
In the implementation for this library Jeff has used the C# 2.0 language's great 'iterator' feature (yield return) to achieve it. By following his examples you can easily program asynchronous calls in an synchronous manner and at the same time, you can still take the advantage of various C# features like foreach/lock/try..catch, and so on. Also, this awesome library has an version for Silverlight.
2. Synchronous Web Service Calls with Silverlight 2: Dispelling the async-only myth
http://www.codeproject.com/KB/silverlight/SynchronousSilverlight.aspx
This great article by Daniel Vaughan is for calling WCF Services in Silverlight, in an synchronous programming style, it's also easy to understand and the idea is explained in detail.
- Easier programming asynchronous calls
- Asynchronous Procedure Calls
- Asynchronous Calls in .Net
- Asynchronous programming
- AsyncCalls2.95 Asynchronous function calls
- Asynchronous programming using coroutines
- Asynchronous programming in C# 5
- 异步编程(Asynchronous Programming)
- win32多线程-异步过程调用(asynchronous Procedure Calls, APCs)
- 异步过程调用(Asynchronous Procedure Calls,APCs)
- Introduction to Asynchronous Programming in .NET 2.0
- Asynchronous Programming Model in .NET 2.0
- An Introduction to Asynchronous Programming and Twisted
- Using epoll() For Asynchronous Network Programming
- Asynchronous Programming Design Patterns (to be continue)
- Asynchronous Socket Programming in C#: Part I
- Asynchronous Socket Programming in C#: Part II
- 异步编程模型(APM,Asynchronous Programming Model)
- 也玩有道难题的双立方数问题:Python 版解法
- 用 Silverlight 开发围棋在线对弈程序(二)MVC
- 用 Silverlight 开发围棋在线对弈程序(一)UI 雏形
- Silverlight 的 Isolated Storage 学习笔记
- VS 2008 Server Explorer 添加数据库连接出错
- Easier programming asynchronous calls
- [Silverlight] 关于线程调用的扩展方法
- [转] Official Microsoft Team Blogs / Microsoft Blogs
- Silverlight 里如何实现隐式样式,ImplicitStyleManager 的实现思想
- IronPython 2.0 is finally released
- 用 Chiron 运行 IronPython 编写的 Silverlight 程序
- 谢谢马骐,谢谢 MVP Team
- 远程桌面超出连接数限制怎么办
- 我的 SciTE 配置文件