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. LeetCode Top100 Liked Questions

    1. TwoSum https://www.cnblogs.com/zhacai/p/10429120.html  easy 2. Add Two Numbers https://www.cnblog ...

  2. (3.11)mysql基础深入——mysql文件分类与配置文件管理

    (3.11)mysql基础深入——mysql文件分类与管理 关键词:mysql配置文件,mysql参数文件,mysql中的my.cnf 目录:mysql数据库文件分类: [1]参数文件:my.cnf ...

  3. 下厨房6月26日数据丢失事故总结 MYSQL主分区被rm 命令误删除

    下厨房6月26日数据丢失事故总结 MYSQL主分区被rm 命令误删除 http://tech.xiachufang.com/?p=18 在6月26日凌晨12点左右,我们在做线上数据库的备库时,误将线上 ...

  4. literallycanvas的简介

    LiterallyCanvas是什么 Literally Canvas是一个可扩展的开源(BSD许可)HTML5绘图组件,可以用于网页中插入画图板,类似于windows自带的画图板.可以用可视化工具绘 ...

  5. 008-jdk1.7版本新特性

    一.JDK1.7 名称:Dolphin(海豚) 发布日期:2011-07-28 新特性: 1.1.switch-case中可以使用字串 区分大小写.Java编译器通过switch使用String对象的 ...

  6. js-jquery-SweetAlert【一】使用

    一.下载安装 地址:http://t4t5.github.io/sweetalert/ 二.页面引用 <script src="dist/sweetalert.min.js" ...

  7. Ceph 分布式存储

    前言 Ceph是一个分布式存储系统,诞生于2004年,最早致力于开发下一代高性能分布式文件系统的项目.随着云计算的发展,ceph乘上了OpenStack的春风,进而成为了开源社区受关注较高的项目之一. ...

  8. [py]py2自带Queue模块实现了3类队列

    py2自带Queue实现了3类队列 先搞清楚几个单词 Queue模块实现了三类队列: FIFO(First In First Out,先进先出,默认为该队列), 我们平时泛指的队列, LIFO(Las ...

  9. PAT A+B for Polynomials[简单]

    1002 A+B for Polynomials (25)(25 分) This time, you are supposed to find A+B where A and B are two po ...

  10. [LeetCode] 152. Maximum Product Subarray_Medium tag: Dynamic Programming

    Given an integer array nums, find the contiguous subarray within an array (containing at least one n ...