Difference between […]Async and Begin[…] .net asynchronous APIs

Note that most *Async methods (with corresponding *Completed events) are using the Event-Based Asynchronous Pattern.

The older (but still perfectly valid) Begin* and End* is a pattern called the Asynchronous Programming Model.

The Socket class is an exception to this rule;

its *Async methods do not have any corresponding events;

it's essentially just APM done in a way to avoid excessive memory allocations.

The biggest difference between APM and EAP is the thread used for completion notification.

APM will call back on a thread pool thread (unless the request completes synchronously).

EAP will use a cross-framework strategy to call back on a UI thread (if the operation was started from a UI thread).

However, both APM and EAP are being replaced with a much more flexible approach based on the Task Parallel Library.

Since the TPL can wrap APMs easily, older classes will likely not be updated directly; extension methods are used to provide Task equivalents for the old APM methods.

For performance reasons, the BCL/TPL teams decided to review each BCL type and add TAP methods directly instead of using extension methods.

These changes will be in .NET 4.5.

AcceptAsync和BeginAccept的区别的更多相关文章

  1. socket AcceptAsync方法的使用

    AcceptAsync与Accept很大的不一样 Accept是一个同步 阻塞的已经封装好底层的方法 AcceptAsync是一个异步 非阻塞未封装的底层连接入口,需要手动填入连接代码用于优化sock ...

  2. c#与java的区别

    经常有人问这种问题,用了些时间java之后,发现这俩玩意除了一小部分壳子长的还有能稍微凑合上,基本上没什么相似之处,可以说也就是马甲层面上的相似吧,还是比较短的马甲... 一般C#多用于业务系统的开发 ...

  3. jquery和Js的区别和基础操作

    jqery的语法和js的语法一样,算是把js升级了一下,这两种语法可以一起使用,只不过是用jqery更加方便 一个页面想要使用jqery的话,先要引入一下jqery包,jqery包从网上下一个就可以, ...

  4. 【原】nodejs全局安装和本地安装的区别

    来微信支付有2年多了,从2年前的互联网模式转变为O2O模式,主要的场景是跟线下的商户去打交道,不像以往的互联网模式,有产品经理提需求,我们帮忙去解决问题. 转型后是这样的,团队成员更多需要去寻找业务的 ...

  5. 探究@property申明对象属性时copy与strong的区别

    一.问题来源 一直没有搞清楚NSString.NSArray.NSDictionary--属性描述关键字copy和strong的区别,看别人的项目中属性定义有的用copy,有的用strong.自己在开 ...

  6. X86和X86_64和X64有什么区别?

    x86是指intel的开发的一种32位指令集,从386开始时代开始的,一直沿用至今,是一种cisc指令集,所有intel早期的cpu,amd早期的cpu都支持这种指令集,ntel官方文档里面称为&qu ...

  7. Java中Comparable与Comparator的区别

    相同 Comparable和Comparator都是用来实现对象的比较.排序 要想对象比较.排序,都需要实现Comparable或Comparator接口 Comparable和Comparator都 ...

  8. MySQL中interactive_timeout和wait_timeout的区别

    在用mysql客户端对数据库进行操作时,打开终端窗口,如果一段时间没有操作,再次操作时,常常会报如下错误: ERROR (HY000): Lost connection to MySQL server ...

  9. 设置line-height:1.5和line-height:150%或者line-height:150px的区别

    直接正题: 看一下line-height可能的值: 其实可以分为两类: (1)不带单位的(如line-height:1.5),这种是推荐使用的: (2)带单位的(如line-heigth:30px/1 ...

随机推荐

  1. Frame报文

    链路层帧常用的帧格式有两种:Ethernet II   与   IEEE802.3 Ethernet II 格式多用于终端设备的通信 IEEE802.3  格式多用于网络设备的通信 如何区分这两种报文 ...

  2. 网络比总线差多了 除非是真正的mpp并行架构

    网络比总线差多了 除非是真正的mpp并行架构 楼方鑫HZproxy里内置一个memory db,可以解决跨库查询中最难的部份.楼方鑫HZ 2015/1/24 21:52:33@joe 用两层DB就好解 ...

  3. 004-redis-命令-哈希操作,列表操作

    Redis hash 命令 下表列出了 redis hash 基本的相关命令: 序号 命令及描述 1 HDEL key field1 [field2] 删除一个或多个哈希表字段 2 HEXISTS k ...

  4. ubuntu 下执行定时任务

    Window shell文件在linux系统下执行不了的解决办法 一些人喜欢用vim来写linux shell script, 但是, 有的人喜欢在Windows下用一些方便的编辑器(比如鼎鼎大名的N ...

  5. 用Servlet获取表单数据

    用Servlet获取表单数据 在webroot下新建userRegist2.jsp 代码如下: <%@ page contentType="text/html;charset=gb23 ...

  6. 谷歌浏览器:audio如何隐藏下载按钮

    当我们使用原生的audio标签时,可以看到如下的效果. 那么如何让下载按钮隐藏掉呢? 1. controlsList="nodownload" // 这个方法只支持 Chrome ...

  7. weka数据挖掘拾遗(二)---- 特征选择(IG、chi-square)

    一.说明 IG是information gain 的缩写,中文名称是信息增益,是选择特征的一个很有效的方法(特别是在使用svm分类时).这里不做详细介绍,有兴趣的可以googling一下. chi-s ...

  8. [LeetCode] 496. Next Greater Element I_Easy tag: Stack

    You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of n ...

  9. 【环境变量】Linux 下三种方式设置环境变量

    1.在Windows 系统下,很多软件安装都需要配置环境变量,比如 安装 jdk ,如果不配置环境变量,在非软件安装的目录下运行javac 命令,将会报告找不到文件,类似的错误. 2.那么什么是环境变 ...

  10. html5shiv.min.js

    今日看代码,发现了绝妙的一句,把它记录下来. <!--[if IE]> <script src="http://libs.useso.com/js/html5shiv/3. ...