Proactor    An Object Behavioral Pattern for Demultiplexingand Dispatching Handlers for Asynchronous Events



Douglas C. Schmidt



Known Uses



The following are some widely documented uses of the Proctor pattern:



I/O Completion Ports in Windows NT:

The Windows NT operating system implements the Proactor pattern.

Various Asynchronous Operations such as accepting new network connections, reading and writing to files and

sockets, and transmission of files across a network connection are supported by Windows NT.

The operating system is the Asynchronous Operation Processor.
Results of the operations are queued up at the I/O completion port
(which plays the role of the Completion Dispatcher).



The UNIX AIO Family of Asynchronous I/O Operations:



On some real-time POSIX platforms, the Proactor pattern is implemented by the aio family of APIs 
These OS features are very similar to the ones described above for Windows NT.
One difference is that UNIX signals can be used to implement an truly asynchronous Completion Dispatcher
(the Windows NT API is not truly asynchronous).


ACE Proactor: 

The Adaptive Communications Environment (ACE)  implements a Proactor component that encapsulates I/O Completion Ports on Windows NT
and the  aio APIs on POSIX platforms. 

The ACE Proactor abstraction provides an OO interface to the standard C APIs supported by Windows NT.

Asynchronous Procedure Calls in Windows NT:




Some

systems (such as Windows NT) support Asynchronous Procedure Calls (APC)s.




An APC is a function that executes asynchronously in the context of a particular thread.
When an APC is queued to a thread, the system issues a software interrupt. 
The next time the thread is scheduled, it will run the APC.
 APCs made by operating system are called
kernelmode APCs. APCs made by an application are called
usermode APCs.




在windowsserver中要创建高性能,灵活server必定涉及到IOCP的使用。而IOCP又是Proactor Pattern的实践。
同一时候随着java跨平台语言的发展。java语言在JDK7(2009年)提供了对于Asyn IO的支持,为java语言作为跨平台网络server提供了更好的支持。
java NIO中的Aysn I/O 同一时候也是一种对于Proactor Pattern的实践。

Proactor 学习1的更多相关文章

  1. 转载:reactor模式学习

    最近又重新看了下netty背后的设计思想,接触到了reactor模型.发现以前虽然也看过reactor和proactor模型的介绍,但是真的是只了解了个皮毛. 再重新学习了一遍,有了更深刻的认识.但是 ...

  2. 每周一荐:学习ACE一定要看的书

    作 者:david++发布时间:2012/06/08 09:02文章地址:http://game-lab.org/?p=320 近两个月都在学习ACE,一个超级强大,也超级复杂的网络框架库.对ACE的 ...

  3. IO设计模式:Reactor和Proactor对比

    IO设计模式:Reactor和Proactor对比 平时接触的开源产品如Redis.ACE,事件模型都使用的Reactor模式:而同样做事件处理的Proactor,由于操作系统的原因,相关的开源产品也 ...

  4. 两种高性能 I/O 设计模式 Reactor 和 Proactor

    两种高性能 I/O 设计模式 Reactor 和 Proactor Reactor 和 Proactor 是基于事件驱动,在网络编程中经常用到两种设计模式. 曾经在一个项目中用到了网络库 libeve ...

  5. 设计模式-前摄器模式(Proactor)

    本周要进行boost asio库的学习,在学习之前发现最好需要先了解一下前摄器模式,这样对asio库的理解很有帮助,故写下此文 我之前写的随笔XShell的模拟实现中的链接方式可以说是同步的(服务器阻 ...

  6. I/O模型之三:两种高性能 I/O 设计模式 Reactor 和 Proactor

    目录: <I/O模型之一:Unix的五种I/O模型> <I/O模型之二:Linux IO模式及 select.poll.epoll详解> <I/O模型之三:两种高性能 I ...

  7. Mudo C++网络库第三章学习笔记

    多线程服务器的适用场合与常用编程模型 进程间通信与线程同步; 以最简单规范的方式开发功能正确.线程安全的多线程程序; 多线程服务器是指运行在linux操作系统上的独占式网络应用程序; 不考虑分布式存储 ...

  8. muduo学习笔记(二)Reactor关键结构

    目录 muduo学习笔记(二)Reactor关键结构 Reactor简述 什么是Reactor Reactor模型的优缺点 poll简述 poll使用样例 muduo Reactor关键结构 Chan ...

  9. Libevent学习之SocketPair实现

    Libevent设计的精化之一在于把Timer事件.Signal事件和IO事件统一集成在一个Reactor中,以统一的方式去处理这三种不同的事件,更确切的说是把Timer事件和Signal事件融合到了 ...

随机推荐

  1. Javascript判断数据类型与真假值隐形转换研究

    一.引言 我们在开发的时候经常要判断真和假,这是我们经常写的代码: if(a){ alert(1) } 那我们怎么判定a是真还是假呢?下面这些值的真假又是多少呢?它们的数据类型又是怎样的呢? &quo ...

  2. Oracle-3 - :超级适合初学者的入门级笔记--用户权限,set运算符,高级子查询

    上一篇的内容在这里第二篇内容, 用户权限:创建用户,创建角色,使用grant  和 revoke 语句赋予和回收权限,创建数据库联接 创建用户:create user xxx identified b ...

  3. 使用NPOI导出图片到EXCEL

    1.首先引用NPOI 2.本例用到的引用 3.在Controller里面添加导出方法 public ActionResult ExportMsgData(string term) { //为list赋 ...

  4. SQL系统函数的使用(实验五)

    SQL系统函数的使用(试验5) 函数在查询语句中的使用 查询员工的姓名和日工资(保留1位小数): 查询并显示部门号为01和02的所有员工的姓名首字及岗位: 查询并显示所有员工的姓名及工龄: 查询199 ...

  5. js判断对象为空 JSON.stringify(obj)

    JSON.stringify(obj) : 用于从一个对象解析出字符串 var c = {}; if(JSON.stringify(obj) == "{}"){ console.l ...

  6. 有关数据传输GET和POST的方法的区别

    有关前后端数据交互,主要是通过走http协议通过post或get的方法,拿angularJS来说:通过JS来发送http请求调用相关接口: $scope.apostDate=function(){ $ ...

  7. 基于HTML5的WebGL经典3D虚拟机房漫游动画

    第一人称在 3D 中的用法要参考第一人称在射击游戏中的使用,第一人称射击游戏(FPS)是以第一人称视角为中心围绕枪和其他武器为基础的视频游戏类型 ; 也就是说,玩家通过主角的眼睛来体验动作.自从流派开 ...

  8. Win32 SDK 编程开始, 创建窗口, 消息的处理, 消息循环

    Windows SDK 编程的一般步骤为: 1. 注册窗口类, 使用到的结构 WNDCLASSEX, 函数 RegisterClassEx. 2. 创建窗口, 函数 CreateWindowEx. 3 ...

  9. 从vultr购买到搭ss看世界

    title: 从Vultr购买到搭ss看世界 date: 2017-11-19 12:28:38 categories: 技术 tags: top: 800 password: 写在前面 ​ 服务器提 ...

  10. struts2的简单执行过程

    struts2是最近刚学的一个框架,想通过写篇文章来加深下印象,这也是本篇博文产生的由来,下面进入正题 Struts2本身是一个挺简单的框架,我们通过写一个登陆的过程来具体描述下其执行过程 1.首先我 ...