为什么会有人想要使用的invoke()(不是的BeginInvoke())? [英] Why would anyone want to use Invoke() (not BeginInvoke())?

查看:158
本文介绍了为什么会有人想要使用的invoke()(不是的BeginInvoke())?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被告知,调用()类似于正常的方法调用......那么,为什么人们选择使用调用,而不是正常的方法调用?

I was told that Invoke() is similar to normal method calling... so why would people choose to use Invoke and not normal method calling?

我试着在网上搜索关于这个问题,我所得到的是使用的BeginInvoke()的优点,但什么是使用调用的优点()?

I tried to search online regarding the issue, what i get is the advantages of using BeginInvoke(), but what are the advantages of using Invoke()?

推荐答案

使用的BeginInvoke 当你要异步调用的委托(从线程池中提取一个线程)和调用如果你想同步调用它。

Use BeginInvoke when you want to call the delegate asynchronously (on a thread drawn from the thread pool) and Invoke if you want to call it synchronously.

这篇关于为什么会有人想要使用的invoke()(不是的BeginInvoke())?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆