zoukankan      html  css  js  c++  java
  • 异步编程知识点记录

    INotifyPropertyChanged
    PropertyChangedEventHandler
    ObservableCollection
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data;
    using System.Data.Entity.ModelConfiguration;
    EntityTypeConfiguration

    DependencyProperty
    DependencyObject
    DispatcherTimer
    INotifyPropertyChanged

    对于委托的异步调用来说,其BeginInvoke函数无非包括以下内容,BeginInvoke(调用参数,回调函数,Object对象)
    AsyncState
    IsHandleCreated
    InvokeRequired、IsDisposed、IsHandleCreated
    AsyncCallback
    IAsyncResult
    ThreadPool.QueueUserWorkItem
     Thread类中的VolatileRead和VolatileWrite方法:
    Precidate
    IEnumerable
    回调方法
    //关于回调方法 ,无返回且带一个参数的委托 , 在异步完成后调用一次
    //由子线程调用,与主线无关
    //public delegate void AsyncCallback(IAsyncResult ar);
    AsyncCallback callback =
    r => Console.WriteLine("I'm CallBack,and{0}", r.AsyncState);//r.AsyncState = "haha"


    ParameterizedThreadStart
    Interlocked

    ParameterizedThreadStart委托是面向带参数方法的
    ThreadPool.QueueUserWorkItem(new WaitCallback(AsyncCallback),"Hello Wrold !");

    * 取消架构,在线程运行时取消当前运行的线程所有操作
    var cts = new CancellationTokenSource();
    Parallel
    ThreadPool.SetMaxThreads(10, 1);

    ThreadPool.QueueUserWorkItem(new WaitCallback(AsyncCallback1), state);

    static CancellationTokenSource tokenSource = new CancellationTokenSource();
    private CancellationToken token = tokenSource.Token;

    AutoResetEvent are = new AutoResetEvent(true);
    Monitor.Enter(syncObj);
    Monitor.Exit(syncObj);
    BeginInvoke
    InvokeRequired
    AutoResetEvent
    Barrier
    CountdownEvent
    ManualResetEventSlim
    Mutex
    ReaderWriterLockSlim
    SemaphoreSlim
    Dispatcher.BeginInvoke 方法 (Action)
    Task.Factory.StartNew
    Parallel.For
    Parallel.ForEach
    Parallel.Invoke
    ParallelLoopResult
    Parallel

  • 相关阅读:
    java web报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
    在cmd下执行mvn help:system 报错
    win10安装mysql5.7
    centos7装单机hadoop2.7.3
    win10装jdk
    oracle中批量修改年份和月份,但不修改时分秒
    Python 正则匹配网页内的IP地址及端口号
    python 爬取网页内的代理服务器列表(需调整优化)
    python 爬取百度url
    Python 爬取SeeBug poc
  • 原文地址:https://www.cnblogs.com/Jeely/p/10760805.html
Copyright © 2011-2022 走看看