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. python jason,pickle

    参考官网 https://docs.python.org/3/library/json.html https://docs.python.org/3/library/pickle.html 了解这两个 ...

  2. Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0,"解决办法

    这是因为先安装了 .NET Framework 4,随后启用了 .NET Framework 3.5 WCF HTTP 激活,则会发生此错误. 只需要已管理员用户在cmd中运行aspnet_regii ...

  3. 利用C#来做ASP.NET的登陆页面

    一.新建一个数据库 新建一个access数据user.mdb. 新建一个user表,添加:UserId(文本类型)及Password(文本类型)两个字段.二.新建一个default.aspx文件. 在 ...

  4. [转载] NoSQL简介

    摘自“百度百科”. NoSQL,泛指非关系型的数据库.随着互联网web2.0网站的兴起,传统的关系数据库在应付web2.0网站,特别是超大规模和高并发的SNS类型的web2.0纯动态网站已经显得力不从 ...

  5. Python和Excel交互

    Python和Excel交互 使用的python包为XlsxWriter 下载的链接 https://pypi.python.org/pypi/XlsxWriter 初级的例子: def write_ ...

  6. 基于HTML5 Canvas 实现商场监控

    伴随国内经济的高速发展,人们对安全的要求越来越高.为了防止下列情况的发生,您需要考虑安装安防系统: 提供证据与线索:很多工厂银行发生偷盗或者事故相关机关可以根据录像信息侦破案件,这个是非常重要的一个线 ...

  7. 使用mysql5.7新特性(虚拟列)解决使用前通配符性能问题

    众所周知,在mysql里的后通配符可以使用索引查找,前通配查询却无法使用到索引,即使是使用到了索引,也是使用了索引全扫描,效率依然不高,再MySQL5.7之前,一直都没有好的办法解决,但是到了MySQ ...

  8. FreeMarker 快速入门

    FreeMarker 快速入门 FreeMarker是一个很值得去学习的模版引擎.它是基于模板文件生成其他文本的通用工具.本章内容通过如何使用FreeMarker生成Html web 页面 和 代码自 ...

  9. 前端面试题:css相关面试题

    CSS 选择器中,元素选择器和类选择器的区别是什么? 元素选择器是最常见的 CSS 选择器,即,文档的元素就是最基本的选择器.选择器通常是某个 HTML 元素,比如 <p>.<h1& ...

  10. Android 个推 踩坑小结

    公司一个项目之前在手机上一直可以正常运行,后来在平板上运行了一下,在欢迎页面卡出了,一直没有反应. 于是我就将项目在电脑上用Android Studio往平板上运行了一遍,看了下打印的Log日志,发现 ...