Thread.Start starts a new OS thread to execute the delegate. When the delegate returns, the thread is destroyed. This is quite a heavy-weight operation (starting and destroying a thread) so you typically only do it if the method is going to be long-running.

Delegate.BeginInvoke will call the delegate on a thread pool thread. Once the method returns, the thread is returned to the pool to be reused by another task. The advantage of this is that queueing a method to the thread pool is relatively light-weight because you don't have to spin up a whole new thread every time.

Control.BeginInvoke invokes the method on the thread for the control. UI components are inherently single-threaded and every interaction with a UI control must be done on the thread that created it. Control.BeginInvoke is a handy way to do that.

Thread.Start和Delegate.BeginInvoke 以及Control.BeginInvoke的更多相关文章

  1. C#Delegate.Invoke、Delegate.BeginInvoke And Control.Invoke、Control.BeginInvoke

    作者:EasonLeung 一.Delegate的Invoke.BeginInvoke 1.Delegate.Invoke (委托同步调用) a.委托的Invoke方法,在当前线程中执行委托. b.委 ...

  2. C# Control.BeginInvoke、synchronizationcontext.post、delegate.BeginInvoke的运行原理

    背景 用到的知识点 1.windows消息机制 备注:鼠标点击.键盘等事件产生的消息要放入系统消息队列,然后再分配到应用程序线程消息队列.软件PostMessage的消息直接进入应用程序线程消息队列, ...

  3. C#中的线程三 (结合ProgressBar学习Control.BeginInvoke)

    C#中的线程三(结合ProgressBar学习Control.BeginInvoke) 本篇继上篇转载的关于Control.BeginInvoke的论述之后,再结合一个实例来说明Cotrol.Begi ...

  4. C#中的线程二(Cotrol.BeginInvoke和Control.Invoke)

    C#中的线程二(Cotrol.BeginInvoke和Control.Invoke) 原文地址:http://www.cnblogs.com/whssunboy/archive/2007/06/07/ ...

  5. Control.Invoke和Control.BeginInvoke

    问题的引入 下面有个简单的demo,大家一看代码就知道效果如何示例.我新建一个winform的程序,然后写入了如下代码: using System; using System.Windows.Form ...

  6. WinForm二三事(三)Control.Invoke&Control.BeginInvoke

    http://www.cnblogs.com/yuyijq/archive/2010/01/11/1643802.html 这个系列从2009年写到2010年,差点又成太监文.随着WPF/Silver ...

  7. 千万别在UI线程上调用Control.Invoke和Control.BeginInvoke,因为这些是依然阻塞UI线程的,造成界面的假死

    原文地址:https://www.cnblogs.com/wangchuang/archive/2013/02/20/2918858.html .c# Invoke和BeginInvoke 区别 Co ...

  8. delegate的Invoke和BeginInvoke方法

    C#中的控件和delegate委托方法都有Invoke和BeginInvoke方法,控件的这两个方法网上讲得很多, 这里就不多说了,下面讲一下delegate的Invoke和BeginInvoke方法 ...

  9. (转)c# control.Invoke control.BeginInvoke

    在Invoke或者BeginInvoke的使用中无一例外地使用了委托Delegate. 一.为什么Control类提供了Invoke和BeginInvoke机制? 关于这个问题的最主要的原因已经是do ...

随机推荐

  1. JS-比较函数中嵌套函数,可以排序【对象数组】

    function createCompareFun(propertyName){ return function(object1,object2){ var value1 = object1[prop ...

  2. sencha touch 入门系列 (六)sencha touch运行及代码解析(下)

    接着上一讲,通过index.html里development.js对app.json里js资源文件的解析,app.js便被index.html引入了, app.js是整个项目的程序入口,在项目完成时使 ...

  3. windows下的mysql迁移到linux下

    最近做毕业设计,需要把windows下的mysql移植到linux下 曾经有过在window下移植mysql数据库的经验,只需要把msql的数据文件复制到另一台安装mysql的机器的数据存放位置,然后 ...

  4. .net Asp AdRotator(广告控件)

    1.新建项目名称AdRotator 2.右键项目名称添加一个xml文件命名为AdRotator.xml <?xml version="1.0" encoding=" ...

  5. Android通知栏的高度获取

    public static int getStatusBarHeight(Context context){ Class<?> c = null; Object obj = null; F ...

  6. struts2的action如果返回null会怎样

    action return nullresponse里直接写要返回的东西, 返回null,就是说视图不跳转到任何地方,当然就出现空白页面了.如果想出现页面就需要在struts.xml文件里面配置res ...

  7. oracle的with as用法

    转自:https://www.cnblogs.com/linjiqin/archive/2013/06/24/3152667.html with as语法–针对一个别名with tmp as (sel ...

  8. mysql格式化日期的函数

    转自:https://www.cnblogs.com/duhuo/p/5650876.html mysql格式化日期   mysql查询记录如果有时间戳字段时,查看结果不方便,不能即时看到时间戳代表的 ...

  9. 最小树形图(poj3164)

    Command Network Time Limit: 1000MS   Memory Limit: 131072K Total Submissions: 12834   Accepted: 3718 ...

  10. JSP教程

    http://www.runoob.com/jsp/jsp-tutorial.html