zoukankan      html  css  js  c++  java
  • Asynchronous Windows Forms Programming

    In a simple Windows Forms application (such as the one created by the Visual Studio.NET application wizard), all forms and controls execute on the same thread – the primordial thread used to launch the application by calling Main() – so those  forms and controls can freely call each other’s methods.

    When a Windows Forms window invokes a call asynchronously (using a delegate) that call executes on a worker thread from the thread pool, not the thread that created the window. The completion callback method is also executed on the worker thread. As a result, the completion callback method should never update the user interface directly because that would be calling a Windows Forms form or control on a different thread from the thread that created it. Similarly, progress reports triggered by the worker thread are not allowed to directly update controls such as a progress bar. In all these cases, you must marshal the call from the worker thread to the user interface thread. This is exactly what the interface ISynchronizeInvoke interface, defined in the System.ComponentModel namespace is designed to do.

    没想到在IssueVision里会带有这样好文章,对异步处理分析得颇透彻,在C# 1.1实现了C# 2.0的功能,对内在的机制也做了详细的分析。
  • 相关阅读:
    codevs 1069关押罪犯
    codevs 1497取余运算
    codevs 3324 新斯诺克
    codevs 3286 火柴排队
    继续畅通工程
    还是畅通工程
    畅通工程(并查集找根节点)
    Eddy's picture(最小生成树)
    Constructing Roads(最小生成树)
    Codeforces Round #383 (Div. 2)C. Arpa's loud Owf and Mehrdad's evil plan
  • 原文地址:https://www.cnblogs.com/jeet/p/15200.html
Copyright © 2011-2022 走看看