AcceptAsync和BeginAccept的区别
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的区别的更多相关文章
- socket AcceptAsync方法的使用
AcceptAsync与Accept很大的不一样 Accept是一个同步 阻塞的已经封装好底层的方法 AcceptAsync是一个异步 非阻塞未封装的底层连接入口,需要手动填入连接代码用于优化sock ...
- c#与java的区别
经常有人问这种问题,用了些时间java之后,发现这俩玩意除了一小部分壳子长的还有能稍微凑合上,基本上没什么相似之处,可以说也就是马甲层面上的相似吧,还是比较短的马甲... 一般C#多用于业务系统的开发 ...
- jquery和Js的区别和基础操作
jqery的语法和js的语法一样,算是把js升级了一下,这两种语法可以一起使用,只不过是用jqery更加方便 一个页面想要使用jqery的话,先要引入一下jqery包,jqery包从网上下一个就可以, ...
- 【原】nodejs全局安装和本地安装的区别
来微信支付有2年多了,从2年前的互联网模式转变为O2O模式,主要的场景是跟线下的商户去打交道,不像以往的互联网模式,有产品经理提需求,我们帮忙去解决问题. 转型后是这样的,团队成员更多需要去寻找业务的 ...
- 探究@property申明对象属性时copy与strong的区别
一.问题来源 一直没有搞清楚NSString.NSArray.NSDictionary--属性描述关键字copy和strong的区别,看别人的项目中属性定义有的用copy,有的用strong.自己在开 ...
- X86和X86_64和X64有什么区别?
x86是指intel的开发的一种32位指令集,从386开始时代开始的,一直沿用至今,是一种cisc指令集,所有intel早期的cpu,amd早期的cpu都支持这种指令集,ntel官方文档里面称为&qu ...
- Java中Comparable与Comparator的区别
相同 Comparable和Comparator都是用来实现对象的比较.排序 要想对象比较.排序,都需要实现Comparable或Comparator接口 Comparable和Comparator都 ...
- MySQL中interactive_timeout和wait_timeout的区别
在用mysql客户端对数据库进行操作时,打开终端窗口,如果一段时间没有操作,再次操作时,常常会报如下错误: ERROR (HY000): Lost connection to MySQL server ...
- 设置line-height:1.5和line-height:150%或者line-height:150px的区别
直接正题: 看一下line-height可能的值: 其实可以分为两类: (1)不带单位的(如line-height:1.5),这种是推荐使用的: (2)带单位的(如line-heigth:30px/1 ...
随机推荐
- 【Pyton】【小甲鱼】爬虫
一.什么是爬虫? 可以理解为一只蜘蛛,在不同的网页上爬来爬去,获取我们需要的资源 二.Python如何访问互联网 urllib(一个包)=url(网页地址)+lib() 第一部分:protocol:/ ...
- 【Python】小练习
1.python爬虫 (1)抓取一个新闻网上含有某一关键字的新闻,http://internasional.kompas.com/就是这个网站上面所有内容含有THAAD这个关键词的新闻 (2)爬取大众 ...
- (3.5)mysql基础深入——mysqld_safe脚本功能及流程
(3.5)mysql基础深入——mysqld_safe脚本功能及流程 目录 1.mysqld_safe过程总结 2.mysql_safe启动的好处 3.mysqld_safe 参数 4.mysqld_ ...
- android动态设置边框颜色
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http: ...
- CentOS工作内容(一)CentOS6.4的安装 hwclock和date
CentOS工作内容(一)CentOS6.4的安装 hwclock和date 光碟安装 分配20G磁盘空间 插入光碟 选择第一项安装 如果要急救的话请选择第三项 启动安装进程 跳过光碟检测 选择nex ...
- react.js 之 create-react-app 命令行工具系统讲解
react.js 教程之 create-react-app 命令行工具系统讲解 快速开始 npm install -g create-react-app create-react-app my-app ...
- PAT 1045 Favorite Color Stripe[dp][难]
1045 Favorite Color Stripe (30)(30 分) Eva is trying to make her own color stripe out of a given one. ...
- Qt元对象系统简介
在Qt中提供了c++的扩展,提供了一种元对象系统的机制,(meta-object-system)的机制.其中包含了信号与槽的内部机制,能够访问到QObject子类的元对象信息的功能. Q_OBJECT ...
- SV中的覆盖率
SV采用CRT的激励形式,而判断验证进度的标准也就是覆盖率(coverage). 覆盖率的两种指定形式:显式的,直接通过SV来指定出的,如SVA,covergroup. 隐式的,在验证过程中,随&qu ...
- Linux 安装gcc、gcc-c++编译器
安装环境 Red Hat Enterprise Linux Server release 7.3 (Maipo) 方式一:yum安装 使用ISO制作yum源:Linux 使用系统ISO制作yum源 y ...