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. phpstorm2016.3+xdebug调试

    1.首先打开PHP配置文件,php.in修改相关xedebug配置 ; XDEBUG Extension [xdebug] zend_extension ="d:/wamp64/bin/ph ...

  2. 数据结构--汉诺塔递归Java实现

    /*汉诺塔递归 * 1.将编号0-N-1个圆盘,从A塔座移动到B上面 * 2.将编号N的1个圆盘,从A移动到C上面 * 3.最后将B上面的N-1个圆盘移动到C上面 * 注意:盘子的编号从上到下1-N ...

  3. StringBulider与StringBuffer的异同

    相同点:两者的功能都是相同的,没有任何差别. 不同点:StringBulider 不是同步的,也是线程不安全的,当使用多线程处理缓冲区时,不能使用.但是单线程访问的时候效率高,如果是单线程处理缓冲区资 ...

  4. python 小白(无编程基础,无计算机基础)的开发之路 day1

    本节内容 Python介绍 发展史 Python 2 or 3? 安装 Hello World程序 变量 用户输入 模块初识 .pyc是个什么鬼? 数据类型初识 数据运算 表达式if ...else语 ...

  5. Git问题集锦

    1.初始新建git,出现No refs in common and none specified; doing nothing 解决方案:Perhaps you should specify a br ...

  6. [转]如何查询SQL Server连接数

    1.获取SQL Server允许同时用户连接的最大数 SELECT @@MAX_CONNECTIONS 2.获取当前指定数据库的连接信息 SELECT * FROM master.dbo.syspro ...

  7. springMVC+spring+MyBatis(SSM)的简单配置

    SSM(Spring+SpringMVC+MyBatis)框架集由Spring.SpringMVC.MyBatis三个开源框架整合而成,常作为数据源较简单的web项目的框架. 其中: Spring是一 ...

  8. (三):C++分布式实时应用框架——系统管理模块

    C++分布式实时应用框架--系统管理模块 上篇:(二): 基于ZeroMQ的实时通讯平台 一个分布式实时系统集群动辄上百台机器,集群的规模已经限定这将是一个"封闭"的系统.你不可能 ...

  9. Go环境搭建

    Linux系统golang环境搭建 1.下载安装包go1.8.linux-amd64.tar golang安装包下载地址:https://golang.org/dl/    ( 有可能被FQ) 2.解 ...

  10. Python:多线程编程

    1.IO编程 IO(input/output).凡是用到数据交换的地方,都会涉及io编程,例如磁盘,网络的数据传输.在IO编程中,stream(流)是一种重要的概念,分为输入流(input strea ...