惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
A
About on SuperTechFans
博客园 - Franky
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
云风的 BLOG
云风的 BLOG
B
Blog
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
Martin Fowler
Martin Fowler
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 叶小钗
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
Last Week in AI
Last Week in AI
腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
爱范儿
爱范儿
V
V2EX
G
Google Developers Blog

博客园 - 旴江老段

委托和事件的区别 如何开发和维能hold住全场的软件 什么样的软件才能hold住全场 SNOOP 开发WPF的好工具 被遗忘的事物 前台线程和后台线程(Foreground and Background Threads) runtime binding policy Checking space used in a database AsyncCallback方法和主线程怎么同步呢? Remoting Practice Sample Using Custom Assemblies with Reports 为什么32位的CPU?为什么32位的CPU只能支持4G的内存呢? 学习SSL和certificate的好网页 Wix Upgrade怎么判断是否更新 学WIX的好网站 SELECT @local_variable (Transact-SQL) sql server try catch and transaction的几个要点 使SQL关键字变大写的小工具 Assert.AreEqual
.net 异步调用机制
旴江老段 · 2009-02-20 · via 博客园 - 旴江老段

异步调用只是提供了异步调用委托的一个机制。

.net framework 为委托自动产生了两个方法:BeginInvoke和EndInvoke。

异步调用时

     先调用BeginInvoke 开始

     再调用EndInvoke结束

如果需要另外一个方法(方法2)去处理委托所代表的方法(方法1)所产生的结果,就可以把一个AsyncCallback 委托对象传给BeginInvoke.

方法1和方法2通过AsyncResult 对象传递委托,和方法1的返回结果。

最后在方法2中调用EndInvoke

note

我想主线程生命要大于子线程的生命。

posted on 2009-02-20 15:05  旴江老段  阅读(503)  评论(0)    收藏  举报

刷新页面返回顶部